From 45d22a7522d184c0015ffabf7fc8726a96ef8724 Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Fri, 28 Feb 2020 17:53:54 -0500 Subject: Testcases for cds actor Adding test cases for cds actor, operator, operation & manager. Coverage is more than 95% overall. Fixed review comments. Issue-ID: POLICY-2384 Change-Id: I64beeb0c46918b990ad7e67248559169fc7940a1 Signed-off-by: Ram Krishna Verma --- .../actorserviceprovider/impl/BidirectionalTopicOperatorTest.java | 7 ++++--- .../controlloop/actorserviceprovider/impl/HttpOperatorTest.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'models-interactions/model-actors/actorServiceProvider/src/test/java') 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 ae923c0bd..b5e3de32c 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 @@ -125,13 +125,14 @@ public class BidirectionalTopicOperatorTest { ControlLoopOperationParams params2 = ControlLoopOperationParams.builder().build(); - // not running yet - assertThatIllegalStateException().isThrownBy(() -> oper2.buildOperation(params2)); - // configure and start it params = BidirectionalTopicParams.builder().sourceTopic(MY_SOURCE).sinkTopic(MY_SINK).timeoutSec(TIMEOUT_SEC) .build(); oper2.configure(Util.translateToMap(OPERATION, params)); + + // not running yet + assertThatIllegalStateException().isThrownBy(() -> oper2.buildOperation(params2)); + oper2.start(); assertSame(operation, oper2.buildOperation(params2)); diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperatorTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperatorTest.java index 873a306c2..f85ef30b6 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperatorTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperatorTest.java @@ -116,13 +116,14 @@ public class HttpOperatorTest { ControlLoopOperationParams params = ControlLoopOperationParams.builder().actor(ACTOR).operation(OPERATION).context(context).build(); - // not running yet - assertThatIllegalStateException().isThrownBy(() -> oper2.buildOperation(params)); - // configure and start it HttpParams params2 = HttpParams.builder().clientName(HTTP_CLIENT).path(PATH).timeoutSec(TIMEOUT).build(); Map paramMap = Util.translateToMap(OPERATION, params2); oper2.configure(paramMap); + + // not running yet + assertThatIllegalStateException().isThrownBy(() -> oper2.buildOperation(params)); + oper2.start(); Operation operation1 = oper2.buildOperation(params); -- cgit 1.2.3-korg