summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.test/src/test
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-11-18 15:27:45 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-18 15:27:45 +0000
commitca468c57a4d09842f2608e32da74b30eba52d015 (patch)
tree2394aa1a842e9b9b560a1ec9baa2e0b6369bdf43 /models-interactions/model-actors/actor.test/src/test
parent041f5dd96839596f985a349f4435787d7a068183 (diff)
parent19ef8b24a98c09a349e6ae7309f535a0135463f6 (diff)
Merge "Make Actors event-agnostic"
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.java1
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java1
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicOperationTest.java35
3 files changed, 2 insertions, 35 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 17ddb391a..6cccc5cb7 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
@@ -103,7 +103,6 @@ public class BasicBidirectionalTopicOperationTest {
@Test
public void testSetUp() {
assertNotNull(oper.config);
- assertNotNull(oper.context);
assertNotNull(oper.outcome);
assertNotNull(oper.executor);
}
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 2327fec00..62c19b80a 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
@@ -64,7 +64,6 @@ public class BasicHttpOperationTest {
assertEquals(200, oper.rawResponse.getStatus());
assertNotNull(oper.future);
assertEquals(BasicHttpOperation.BASE_URI, oper.client.getBaseUrl());
- assertNotNull(oper.context);
assertNotNull(oper.outcome);
assertNotNull(oper.executor);
}
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 60d3ddd31..fe06ad52f 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
@@ -24,19 +24,13 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
import java.util.Map;
-import java.util.concurrent.CompletableFuture;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.resources.ResourceUtils;
-import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
-import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.Util;
-import org.onap.policy.controlloop.actorserviceprovider.impl.OperationPartial;
public class BasicOperationTest {
private static final String ACTOR = "my-actor";
@@ -67,39 +61,24 @@ public class BasicOperationTest {
@Test
public void testSetUp() throws Exception {
assertNotNull(oper.future);
- assertNotNull(oper.context);
assertNotNull(oper.outcome);
assertNotNull(oper.executor);
- assertNotNull(oper.guardOperation);
-
- CompletableFuture<OperationOutcome> future = oper.service.getActor(OperationPartial.GUARD_ACTOR_NAME)
- .getOperator(OperationPartial.GUARD_OPERATION_NAME).buildOperation(null).start();
- assertTrue(future.isDone());
- assertEquals(OperationResult.SUCCESS, future.get().getResult());
}
@Test
public void testMakeContext() {
oper.makeContext();
- assertTrue(oper.enrichment.isEmpty());
-
- assertSame(BasicHttpOperation.REQ_ID, oper.event.getRequestId());
- assertSame(oper.enrichment, oper.event.getAai());
-
- assertSame(oper.event, oper.context.getEvent());
-
- assertSame(oper.context, oper.params.getContext());
assertSame(oper.service, oper.params.getActorService());
assertSame(oper.executor, oper.params.getExecutor());
assertEquals(ACTOR, oper.params.getActor());
assertEquals(OPERATION, oper.params.getOperation());
+ assertSame(BasicHttpOperation.REQ_ID, oper.params.getRequestId());
assertEquals(BasicHttpOperation.TARGET_ENTITY, oper.params.getTargetEntity());
}
@Test
- public void testMakeEnrichment_testMakePayload() {
- assertTrue(oper.makeEnrichment().isEmpty());
+ public void testMakePayload() {
assertNull(oper.makePayload());
}
@@ -108,14 +87,4 @@ public class BasicOperationTest {
Map<String, Object> map = Util.translateToMap("", ResourceUtils.getResourceAsString("actual.json"));
oper.verifyRequest("expected.json", map, "svc-request-id", "vnf-id");
}
-
- @Test
- public void testProvideCqResponse() throws Exception {
- AaiCqResponse cq = new AaiCqResponse("{}");
- oper.provideCqResponse(cq);
-
- assertSame(cq, oper.context.getProperty(AaiCqResponse.CONTEXT_KEY));
- assertTrue(oper.cqFuture.isDone());
- assertEquals(OperationResult.SUCCESS, oper.cqFuture.get().getResult());
- }
}