summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.test/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-02-17 22:25:03 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-17 22:25:03 +0000
commit85a2fee4074903012e77f78e26328b9a03a8bdfc (patch)
treee4c281ec3d174150a62bbb640ba7883aef23fd0e /models-interactions/model-actors/actor.test/src
parent22e831dbd5820b54bb24131e007190b70e3321d4 (diff)
parent28ca4d196bb0e8c50ad64b5bfde117a93ace3e04 (diff)
Merge "Use BidirectionalTopicClient from policy-common"
Diffstat (limited to 'models-interactions/model-actors/actor.test/src')
-rw-r--r--models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java10
-rw-r--r--models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java2
2 files changed, 10 insertions, 2 deletions
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 cd9681c8e..e160479b3 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
@@ -36,6 +36,7 @@ import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientFactory;
+import org.onap.policy.common.utils.time.PseudoExecutor;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actorserviceprovider.ActorService;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
@@ -90,6 +91,7 @@ public class BasicHttpOperation<Q> {
protected VirtualControlLoopEvent event;
protected ControlLoopEventContext context;
protected OperationOutcome outcome;
+ protected PseudoExecutor executor;
/**
* Constructs the object using a default actor and operation name.
@@ -123,6 +125,8 @@ public class BasicHttpOperation<Q> {
future = new CompletableFuture<>();
when(client.getBaseUrl()).thenReturn(BASE_URI);
+ executor = new PseudoExecutor();
+
makeContext();
outcome = params.makeOutcome();
@@ -133,6 +137,8 @@ public class BasicHttpOperation<Q> {
/**
* Reinitializes {@link #enrichment}, {@link #event}, {@link #context}, and
* {@link #params}.
+ * <p/>
+ * Note: {@link #params} is configured to use {@link #executor}.
*/
protected void makeContext() {
enrichment = new TreeMap<>(makeEnrichment());
@@ -143,8 +149,8 @@ public class BasicHttpOperation<Q> {
context = new ControlLoopEventContext(event);
- params = ControlLoopOperationParams.builder().context(context).actorService(service).actor(actorName)
- .operation(operationName).targetEntity(TARGET_ENTITY).build();
+ params = ControlLoopOperationParams.builder().executor(executor).context(context).actorService(service)
+ .actor(actorName).operation(operationName).targetEntity(TARGET_ENTITY).build();
}
/**
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 1de2f923d..096b8b80d 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
@@ -67,6 +67,7 @@ public class BasicHttpOperationTest {
assertEquals(BasicHttpOperation.BASE_URI, oper.client.getBaseUrl());
assertNotNull(oper.context);
assertNotNull(oper.outcome);
+ assertNotNull(oper.executor);
assertTrue(oper.operator.isAlive());
}
@@ -83,6 +84,7 @@ public class BasicHttpOperationTest {
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());
assertEquals(BasicHttpOperation.TARGET_ENTITY, oper.params.getTargetEntity());