diff options
author | Jim Hahn <jrh3@att.com> | 2021-02-11 16:13:32 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-02-11 16:15:51 -0500 |
commit | a57710faad56015eb3b69a5ce6f8da235ca146c7 (patch) | |
tree | fe33c429826d67b8d11b7333d051173a105244f5 /policy-endpoints/src/test/java/org | |
parent | e3035927b9c49478e28e5ca7fca7c42c43b7300e (diff) |
Fix sonars from depeendency upgrade
The dependency upgrades in policy-parent caused some new sonars. In
particular, initMocks() has been deprecated - replaced with calls to the
Mockito Runner.
Issue-ID: POLICY-2914
Change-Id: Iaf10f676c380adb9785e836cb15792596b378e4e
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org')
-rw-r--r-- | policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java index ffa7c5a1..cfb65e16 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java @@ -37,8 +37,9 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; @@ -46,6 +47,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicListener; import org.onap.policy.common.endpoints.event.comm.TopicSink; import org.onap.policy.common.endpoints.event.comm.TopicSource; +@RunWith(MockitoJUnitRunner.class) public class BidirectionalTopicClientTest { private static final String SINK_TOPIC = "my-sink-topic"; private static final String SOURCE_TOPIC = "my-source-topic"; @@ -90,8 +92,6 @@ public class BidirectionalTopicClientTest { */ @Before public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - when(sink.send(anyString())).thenReturn(true); when(sink.getTopicCommInfrastructure()).thenReturn(SINK_INFRA); |