summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.test/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-21 09:55:38 -0400
committerJim Hahn <jrh3@att.com>2020-07-21 16:25:53 -0400
commit248a660d61fa03caa4710cf8cfe144eb245b807b (patch)
tree9f7c9aa7fda6d9ab9977bf2398a0136a787dc62a /models-interactions/model-actors/actor.test/src/test
parentf203526d0f86d385976da394bd1f0f918e4445d9 (diff)
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 <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.test/src/test')
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperationTest.java7
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java6
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java4
3 files changed, 8 insertions, 9 deletions
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<String, StandardCoderObject> listener;
- private BasicBidirectionalTopicOperation oper;
+ private BasicBidirectionalTopicOperation<String> 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<String> {
public MyOperation() {
super();
}
@@ -149,8 +149,7 @@ public class BasicBidirectionalTopicOperationTest {
}
@Override
- @SuppressWarnings("rawtypes")
- protected TopicServer makeServer(TopicSink sink, TopicSource source) {
+ protected TopicServer<String> makeServer(TopicSink sink, TopicSource source) {
return new TopicServer<String>(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<String> 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);
}