diff options
author | Jim Hahn <jrh3@att.com> | 2020-07-21 09:55:38 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-07-21 16:25:53 -0400 |
commit | 248a660d61fa03caa4710cf8cfe144eb245b807b (patch) | |
tree | 9f7c9aa7fda6d9ab9977bf2398a0136a787dc62a /models-interactions/model-actors | |
parent | f203526d0f86d385976da394bd1f0f918e4445d9 (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')
25 files changed, 39 insertions, 45 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java index c6e273d50..173eb2908 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java @@ -60,7 +60,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; import org.onap.policy.controlloop.policy.PolicyResult; -public class AaiCustomQueryOperationTest extends BasicAaiOperation<Map<String, String>> { +public class AaiCustomQueryOperationTest extends BasicAaiOperation { private static final StandardCoder coder = new StandardCoder(); private static final String MY_LINK = "my-link"; diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java index 673b6519b..df0dbff98 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java @@ -40,7 +40,7 @@ import org.onap.policy.aai.AaiConstants; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; -public class AaiGetOperationTest extends BasicAaiOperation<Void> { +public class AaiGetOperationTest extends BasicAaiOperation { private static final String MY_NAME = "my-operation-name"; private static final String PARAM_NAME = "my-param"; private static final String PARAM_VALUE = "my-value"; diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java index d197789ca..042b64f60 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java @@ -44,7 +44,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.policy.PolicyResult; -public class AaiGetPnfOperationTest extends BasicAaiOperation<Void> { +public class AaiGetPnfOperationTest extends BasicAaiOperation { private static final String INPUT_FIELD = "input"; private static final String TEXT = "my-text"; diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java index 1e9a1d987..be8a26416 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java @@ -44,7 +44,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.policy.PolicyResult; -public class AaiGetTenantOperationTest extends BasicAaiOperation<Void> { +public class AaiGetTenantOperationTest extends BasicAaiOperation { private static final String INPUT_FIELD = "input"; private static final String TEXT = "my-text"; diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java index ae38cca35..ca8233a4d 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java @@ -23,7 +23,7 @@ package org.onap.policy.controlloop.actor.aai; import java.util.Map; import org.junit.Test; -public class AaiUtilTest extends BasicAaiOperation<Void> { +public class AaiUtilTest extends BasicAaiOperation { @Test public void testMakeHeaders() { diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java index 2715bfe29..1f481ae0f 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java @@ -32,7 +32,7 @@ import org.onap.policy.simulators.Util; /** * Superclass for various operator tests. */ -public abstract class BasicAaiOperation<Q> extends BasicHttpOperation<Q> { +public abstract class BasicAaiOperation extends BasicHttpOperation { /** * Constructs the object using a default actor and operation name. diff --git a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/BasicAppcOperation.java b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/BasicAppcOperation.java index 546a38d3a..1a8c60350 100644 --- a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/BasicAppcOperation.java +++ b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/BasicAppcOperation.java @@ -32,6 +32,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import java.util.function.BiConsumer; +import org.onap.policy.appc.Request; import org.onap.policy.appc.Response; import org.onap.policy.appc.ResponseCode; import org.onap.policy.appc.ResponseStatus; @@ -53,7 +54,7 @@ import org.powermock.reflect.Whitebox; /** * Superclass for various operator tests. */ -public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperation { +public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperation<Request> { protected static final String[] IGNORE_FIELDS = {"RequestID", "subRequestID", "TimeStamp"}; protected static final String MY_DESCRIPTION = "my-description"; protected static final String MY_VNF = "my-vnf"; @@ -102,8 +103,7 @@ public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperatio super.tearDownBasic(); } - @SuppressWarnings("rawtypes") - protected TopicServer makeServer(TopicSink sink, TopicSource source) { + protected TopicServer<Request> makeServer(TopicSink sink, TopicSource source) { return new AppcLegacyTopicServer(sink, source); } diff --git a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java index fcfb6b868..6059cb5ed 100644 --- a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java +++ b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java @@ -63,7 +63,7 @@ import org.onap.policy.controlloop.policy.Target; import org.onap.policy.simulators.AppcLcmTopicServer; import org.onap.policy.simulators.TopicServer; -public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { +public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation<AppcLcmDmaapWrapper> { private static final String EXPECTED_EXCEPTION = "expected exception"; private static final String PAYLOAD_KEY1 = "key-A"; @@ -103,8 +103,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { super.tearDownBasic(); } - @SuppressWarnings("rawtypes") - protected TopicServer makeServer(TopicSink sink, TopicSource source) { + protected TopicServer<AppcLcmDmaapWrapper> makeServer(TopicSink sink, TopicSource source) { return new AppcLcmTopicServer(sink, source); } diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java index da0ee95b5..6fe8ceac2 100644 --- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java +++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java @@ -54,7 +54,7 @@ import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; import org.onap.policy.simulators.GuardSimulatorJaxRs; -public class DecisionOperationTest extends BasicHttpOperation<DecisionRequest> { +public class DecisionOperationTest extends BasicHttpOperation { @Mock private Consumer<OperationOutcome> started; diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java index 5cc09560f..8c45bc303 100644 --- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java +++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java @@ -52,7 +52,7 @@ import org.powermock.reflect.Whitebox; /** * Superclass for various operator tests. */ -public abstract class BasicSdncOperation extends BasicHttpOperation<SdncRequest> { +public abstract class BasicSdncOperation extends BasicHttpOperation { /** * Fields to be ignored when comparing requests with JSON. */ diff --git a/models-interactions/model-actors/actor.sdnr/src/test/java/org/onap/policy/controlloop/actor/sdnr/BasicSdnrOperation.java b/models-interactions/model-actors/actor.sdnr/src/test/java/org/onap/policy/controlloop/actor/sdnr/BasicSdnrOperation.java index 15f919b21..385052fec 100644 --- a/models-interactions/model-actors/actor.sdnr/src/test/java/org/onap/policy/controlloop/actor/sdnr/BasicSdnrOperation.java +++ b/models-interactions/model-actors/actor.sdnr/src/test/java/org/onap/policy/controlloop/actor/sdnr/BasicSdnrOperation.java @@ -49,7 +49,7 @@ import org.onap.policy.simulators.SdnrTopicServer; import org.onap.policy.simulators.TopicServer; import org.powermock.reflect.Whitebox; -public abstract class BasicSdnrOperation extends BasicBidirectionalTopicOperation { +public abstract class BasicSdnrOperation extends BasicBidirectionalTopicOperation<PciMessage> { protected PciMessage response; @@ -94,8 +94,7 @@ public abstract class BasicSdnrOperation extends BasicBidirectionalTopicOperatio super.tearDownBasic(); } - @SuppressWarnings("rawtypes") - protected TopicServer makeServer(TopicSink sink, TopicSource source) { + protected TopicServer<PciMessage> makeServer(TopicSink sink, TopicSource source) { return new SdnrTopicServer(sink, source); } diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java index c67243f9f..dc8b0d606 100644 --- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java +++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java @@ -134,7 +134,6 @@ public class VfModuleDelete extends SoOperation { * HttpClient, as the JerseyClient does not support it. This will add the content-type * and authorization headers, so they should not be included within "headers". * - * @param <Q> request type * @param uri URI suffix, to be appended to the URI prefix * @param headers headers to be included * @param contentType content type of the request @@ -143,7 +142,7 @@ public class VfModuleDelete extends SoOperation { * @return a future to await the response. Note: it's untested whether canceling this * future will actually cancel the underlying HTTP request */ - protected <Q> CompletableFuture<Response> delete(String uri, Map<String, Object> headers, String contentType, + protected CompletableFuture<Response> delete(String uri, Map<String, Object> headers, String contentType, String request, InvocationCallback<Response> callback) { // TODO move to HttpOperation diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java index c8afab450..3541333c0 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java @@ -47,7 +47,7 @@ import org.onap.policy.so.SoResponse; /** * Superclass for various operator tests. */ -public abstract class BasicSoOperation extends BasicHttpOperation<SoRequest> { +public abstract class BasicSoOperation extends BasicHttpOperation { protected static final String[] IGNORE_FIELDS = {"RequestID", "subRequestID", "seconds", "nanos"}; public static final String MODEL_CUSTOM_ID = "my-model-customization-id"; diff --git a/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperation.java b/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperation.java index c8b69677f..fc4545966 100644 --- a/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperation.java +++ b/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicBidirectionalTopicOperation.java @@ -45,8 +45,10 @@ import org.onap.policy.simulators.Util; /** * Superclass for various BidirectionalTopicOperation tests. + * + * @param <Q> request type */ -public abstract class BasicBidirectionalTopicOperation extends BasicOperation { +public abstract class BasicBidirectionalTopicOperation<Q> extends BasicOperation { protected static final String MY_SINK = "my-sink"; protected static final String MY_SOURCE = "my-source"; protected static final int TIMEOUT_SEC = 10; @@ -74,8 +76,7 @@ public abstract class BasicBidirectionalTopicOperation extends BasicOperation { @Mock protected BidirectionalTopicConfig config; - @SuppressWarnings("rawtypes") - private TopicServer topicServer; + private TopicServer<Q> topicServer; /** * Constructs the object using a default actor and operation name. @@ -161,8 +162,7 @@ public abstract class BasicBidirectionalTopicOperation extends BasicOperation { * @param source topic from which the simulator should receive messages * @return a new topic server/simulator */ - @SuppressWarnings("rawtypes") - protected abstract TopicServer makeServer(TopicSink sink, TopicSource source); + protected abstract TopicServer<Q> makeServer(TopicSink sink, TopicSource source); /** * Initializes a configuration. diff --git a/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java b/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java index 4331edb04..02225759c 100644 --- a/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java +++ b/models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java @@ -42,10 +42,8 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; /** * Superclass for various HttpOperation tests. - * - * @param <Q> request type */ -public class BasicHttpOperation<Q> extends BasicOperation { +public class BasicHttpOperation extends BasicOperation { protected static final String MY_CLIENT = "my-client"; protected static final String BASE_URI = "http://my-host:6969/base-uri/"; protected static final String PATH = "my-path/"; 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); } diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java index d41da1b87..9014e3332 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java @@ -29,10 +29,9 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInst import org.onap.policy.controlloop.actor.test.BasicHttpOperation; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingConfig; import org.onap.policy.simulators.Util; -import org.onap.policy.vfc.VfcRequest; import org.onap.policy.vfc.VfcResponse; -public abstract class BasicVfcOperation extends BasicHttpOperation<VfcRequest> { +public abstract class BasicVfcOperation extends BasicHttpOperation { public static final String POLL_PATH = "my-path-get/"; public static final int MAX_POLLS = 3; public static final int POLL_WAIT_SEC = 20; diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingActorParams.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingActorParams.java index 3343c5b3c..8cb3e7c0a 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingActorParams.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingActorParams.java @@ -24,7 +24,6 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.onap.policy.common.parameters.annotations.Min; -import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpActorParams; /** * Parameters used by Actors that, after issuing an HTTP request, must poll the target diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingParams.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingParams.java index 2f33bd217..7244aeec3 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingParams.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/HttpPollingParams.java @@ -26,7 +26,6 @@ import lombok.experimental.SuperBuilder; import org.onap.policy.common.parameters.annotations.Min; import org.onap.policy.common.parameters.annotations.NotBlank; import org.onap.policy.common.parameters.annotations.NotNull; -import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; /** * Parameters used by Operators that, after issuing an HTTP request, must poll the target diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/pipeline/ListenerManager.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/pipeline/ListenerManager.java index b810de393..999aea7be 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/pipeline/ListenerManager.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/pipeline/ListenerManager.java @@ -101,7 +101,6 @@ public class ListenerManager { * @param listener listener to be executed */ protected void runListener(Runnable listener) { - // TODO do this asynchronously? Util.runFunction(listener, "pipeline listener {} threw an exception", listener); } diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicActorTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicActorTest.java index dfd3f8bc6..6a8813cc6 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicActorTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicActorTest.java @@ -173,7 +173,8 @@ public class BidirectionalTopicActorTest { // with invalid actor parameters params.setOperations(null); - assertThatThrownBy(() -> prov.makeOperatorParameters(Util.translateToMap(prov.getName(), params))) + Map<String, Object> map = Util.translateToMap(prov.getName(), params); + assertThatThrownBy(() -> prov.makeOperatorParameters(map)) .isInstanceOf(ParameterValidationRuntimeException.class); } diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperatorTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperatorTest.java index ff59176a1..d0dc0a759 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperatorTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperatorTest.java @@ -29,6 +29,7 @@ import static org.mockito.Mockito.when; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import org.junit.Before; import org.junit.Test; @@ -97,7 +98,8 @@ public class BidirectionalTopicOperatorTest { // invalid parameters params.setSourceTopic(null); - assertThatThrownBy(() -> oper.configure(Util.translateToMap(OPERATION, params))) + Map<String, Object> map = Util.translateToMap(OPERATION, params); + assertThatThrownBy(() -> oper.configure(map)) .isInstanceOf(ParameterValidationRuntimeException.class); } diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpActorTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpActorTest.java index a28b98c81..5407f1fee 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpActorTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpActorTest.java @@ -74,7 +74,8 @@ public class HttpActorTest { // with invalid actor parameters params.setOperations(null); - assertThatThrownBy(() -> prov.makeOperatorParameters(Util.translateToMap(prov.getName(), params))) + Map<String, Object> map = Util.translateToMap(prov.getName(), params); + assertThatThrownBy(() -> prov.makeOperatorParameters(map)) .isInstanceOf(ParameterValidationRuntimeException.class); } |