From 248a660d61fa03caa4710cf8cfe144eb245b807b Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 21 Jul 2020 09:55:38 -0400 Subject: Fix some sonars in policy-models Fixed the following sonar issues in some of the project directories: - use assertNull, assertEquals, etc. - swap assertEquals arguments - extract a constant - don't invoke toString() in logger calls - TODOs - generic types Issue-ID: POLICY-2714 Change-Id: Id8803f9bf617ea9fc173a67b8606600709b55bdc Signed-off-by: Jim Hahn --- .../actor/test/BasicBidirectionalTopicOperationTest.java | 7 +++---- .../onap/policy/controlloop/actor/test/BasicHttpOperationTest.java | 6 +++--- .../org/onap/policy/controlloop/actor/test/BasicOperationTest.java | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'models-interactions/model-actors/actor.test/src/test') diff --git a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperationTest.java b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperationTest.java index afb8f075e..17ddb391a 100644 --- a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperationTest.java +++ b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperationTest.java @@ -48,7 +48,7 @@ public class BasicBidirectionalTopicOperationTest { @Mock private BiConsumer listener; - private BasicBidirectionalTopicOperation oper; + private BasicBidirectionalTopicOperation oper; @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -133,7 +133,7 @@ public class BasicBidirectionalTopicOperationTest { .withMessage("response is not a Map"); } - private static class MyOperation extends BasicBidirectionalTopicOperation { + private static class MyOperation extends BasicBidirectionalTopicOperation { public MyOperation() { super(); } @@ -149,8 +149,7 @@ public class BasicBidirectionalTopicOperationTest { } @Override - @SuppressWarnings("rawtypes") - protected TopicServer makeServer(TopicSink sink, TopicSource source) { + protected TopicServer makeServer(TopicSink sink, TopicSource source) { return new TopicServer(sink, source, null, String.class) { @Override protected String process(String request) { diff --git a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java index c19aa487c..2327fec00 100644 --- a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java +++ b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java @@ -35,18 +35,18 @@ public class BasicHttpOperationTest { private static final String ACTOR = "my-actor"; private static final String OPERATION = "my-operation"; - private BasicHttpOperation oper; + private BasicHttpOperation oper; @Before public void setUp() throws Exception { - oper = new BasicHttpOperation<>(ACTOR, OPERATION); + oper = new BasicHttpOperation(ACTOR, OPERATION); oper.setUpBasic(); } @Test public void testBasicHttpOperation() { - oper = new BasicHttpOperation<>(); + oper = new BasicHttpOperation(); assertEquals(BasicOperation.DEFAULT_ACTOR, oper.actorName); assertEquals(BasicOperation.DEFAULT_OPERATION, oper.operationName); } diff --git a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java index 5eb35e9d0..047378baf 100644 --- a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java +++ b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java @@ -47,13 +47,13 @@ public class BasicOperationTest { @Before public void setUp() throws Exception { - oper = new BasicHttpOperation<>(ACTOR, OPERATION); + oper = new BasicHttpOperation(ACTOR, OPERATION); oper.setUpBasic(); } @Test public void testBasicHttpOperation() { - oper = new BasicHttpOperation<>(); + oper = new BasicHttpOperation(); assertEquals(BasicHttpOperation.DEFAULT_ACTOR, oper.actorName); assertEquals(BasicHttpOperation.DEFAULT_OPERATION, oper.operationName); } -- cgit 1.2.3-korg