From e173fc5ab13b095d8f70fd8a8d4d063adeba6e6b Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 5 Jul 2019 10:52:20 -0400 Subject: Fix sonar issues in policy/endpoints Sonar fixes, other than code coverage. These changes are disruptive and will likely cause breakage in a number of policy repos. Renamed constants. Moved constants/factories from interfaces to classes. Change-Id: I182d50320aa6b53e383081af806c60dd2f806cbe Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn --- .../endpoints/event/comm/client/TopicSinkClientTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java') diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java index 07630cd4..e30f38a7 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java @@ -38,7 +38,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; +import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; import org.onap.policy.common.endpoints.event.comm.TopicSink; public class TopicSinkClientTest { @@ -66,14 +66,14 @@ public class TopicSinkClientTest { props.setProperty("noop.sink.topics", TOPIC); // clear all topics and then configure one topic - TopicEndpoint.manager.shutdown(); - TopicEndpoint.manager.addTopicSinks(props); + TopicEndpointManager.getManager().shutdown(); + TopicEndpointManager.getManager().addTopicSinks(props); } @AfterClass public static void tearDown() { // clear all topics after the tests - TopicEndpoint.manager.shutdown(); + TopicEndpointManager.getManager().shutdown(); } /** @@ -82,7 +82,7 @@ public class TopicSinkClientTest { @Test public void testGetTopicSinks() throws Exception { - sink = TopicEndpoint.manager.getNoopTopicSink(TOPIC); + sink = TopicEndpointManager.getManager().getNoopTopicSink(TOPIC); assertNotNull(sink); final AtomicReference evref = new AtomicReference<>(null); @@ -106,7 +106,7 @@ public class TopicSinkClientTest { @Test public void testTopicSinkClient_GetTopic() throws TopicSinkClientException { - assertEquals(TOPIC, new TopicSinkClient(TopicEndpoint.manager.getNoopTopicSink(TOPIC)).getTopic()); + assertEquals(TOPIC, new TopicSinkClient(TopicEndpointManager.getManager().getNoopTopicSink(TOPIC)).getTopic()); assertEquals(TOPIC, new TopicSinkClient(TOPIC).getTopic()); assertThatThrownBy(() -> new TopicSinkClient((TopicSink) null)).isInstanceOf(IllegalArgumentException.class); -- cgit 1.2.3-korg