From 35df1fc5ff6afeb892806796bb3afa76deddac6a Mon Sep 17 00:00:00 2001 From: elinuxhenrik Date: Thu, 2 Jul 2020 09:53:46 +0200 Subject: [PATCH] Remove Sonar issues Change-Id: I4f94ae9b948210e613a6bc356772ce169b8714e2 Signed-off-by: elinuxhenrik --- .../test/java/org/oransc/policyagent/ApplicationTest.java | 12 ++++++------ .../org/oransc/policyagent/tasks/RefreshConfigTaskTest.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java b/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java index 1a73fbbe..fac28b9c 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java @@ -363,7 +363,7 @@ class ApplicationTest { * * @throws ServiceException */ - void testErrorFromRIC() throws ServiceException { + void testErrorFromRic() throws ServiceException { putService("service1"); addPolicyType("type1", "ric1"); @@ -596,7 +596,7 @@ class ApplicationTest { List info = parseList(rsp, ServiceStatus.class); assertThat(info).hasSize(1); ServiceStatus status = info.iterator().next(); - assertThat(status.keepAliveIntervalSeconds).isEqualTo(0); + assertThat(status.keepAliveIntervalSeconds).isZero(); assertThat(status.serviceName).isEqualTo(serviceName); // GET (all) @@ -614,7 +614,7 @@ class ApplicationTest { assertThat(services.size()).isEqualTo(1); url = "/services?name=name"; restClient().delete(url).block(); - assertThat(services.size()).isEqualTo(0); + assertThat(services.size()).isZero(); // Keep alive, no registered service testErrorCode(restClient().put("/services/keepalive?name=name", ""), HttpStatus.NOT_FOUND); @@ -643,8 +643,8 @@ class ApplicationTest { assertThat(services.size()).isEqualTo(1); // Timeout after ~1 second - await().untilAsserted(() -> assertThat(policies.size()).isEqualTo(0)); - assertThat(services.size()).isEqualTo(0); + await().untilAsserted(() -> assertThat(policies.size()).isZero()); + assertThat(services.size()).isZero(); } @Test @@ -731,7 +731,7 @@ class ApplicationTest { for (Thread t : threads) { t.join(); } - assertThat(policies.size()).isEqualTo(0); + assertThat(policies.size()).isZero(); logger.info("Concurrency test took " + Duration.between(startTime, Instant.now())); } diff --git a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java index 1b14703b..673ed68a 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java @@ -215,7 +215,7 @@ class RefreshConfigTaskTest { // Then verify(refreshTaskUnderTest).loadConfigurationFromFile(); - assertThat(appConfig.getRicConfigs()).hasSize(0); + assertThat(appConfig.getRicConfigs()).isEmpty(); await().until(() -> logAppender.list.size() > 0); assertThat(logAppender.list.get(0).getFormattedMessage()) -- 2.16.6