summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.cds
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.cds')
-rw-r--r--models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java2
-rw-r--r--models-interactions/model-actors/actor.cds/src/test/java/org/onap/policy/controlloop/actor/cds/GrpcActorServiceManagerTest.java12
2 files changed, 9 insertions, 5 deletions
diff --git a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java
index 2afa9fa2e..d0f5bd2b4 100644
--- a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java
+++ b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java
@@ -62,10 +62,12 @@ public class CdsActorServiceManager implements CdsProcessorListener {
break;
case EVENT_COMPONENT_EXECUTED:
outcome.setResult(PolicyResult.SUCCESS);
+ outcome.setResponse(message);
future.complete(outcome);
break;
default:
outcome.setResult(PolicyResult.FAILURE);
+ outcome.setResponse(message);
future.complete(outcome);
break;
}
diff --git a/models-interactions/model-actors/actor.cds/src/test/java/org/onap/policy/controlloop/actor/cds/GrpcActorServiceManagerTest.java b/models-interactions/model-actors/actor.cds/src/test/java/org/onap/policy/controlloop/actor/cds/GrpcActorServiceManagerTest.java
index 83473a89a..908b05c08 100644
--- a/models-interactions/model-actors/actor.cds/src/test/java/org/onap/policy/controlloop/actor/cds/GrpcActorServiceManagerTest.java
+++ b/models-interactions/model-actors/actor.cds/src/test/java/org/onap/policy/controlloop/actor/cds/GrpcActorServiceManagerTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.controlloop.actor.cds;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.util.concurrent.CompletableFuture;
@@ -59,8 +60,9 @@ public class GrpcActorServiceManagerTest {
Status status = Status.newBuilder().setEventType(EventType.EVENT_COMPONENT_EXECUTED).build();
output = ExecutionServiceOutput.newBuilder().setStatus(status).build();
manager.onMessage(output);
- assertEquals(PolicyResult.SUCCESS, future.get(2, TimeUnit.SECONDS).getResult());
- assertTrue(future.isDone());
+ OperationOutcome outcome = future.get(2, TimeUnit.SECONDS);
+ assertEquals(PolicyResult.SUCCESS, outcome.getResult());
+ assertSame(output, outcome.getResponse());
}
@Test
@@ -79,8 +81,9 @@ public class GrpcActorServiceManagerTest {
Status status = Status.newBuilder().setEventType(EventType.EVENT_COMPONENT_FAILURE).build();
output = ExecutionServiceOutput.newBuilder().setStatus(status).build();
manager.onMessage(output);
- assertEquals(PolicyResult.FAILURE, future.get(2, TimeUnit.SECONDS).getResult());
- assertTrue(future.isDone());
+ OperationOutcome outcome = future.get(2, TimeUnit.SECONDS);
+ assertEquals(PolicyResult.FAILURE, outcome.getResult());
+ assertSame(output, outcome.getResponse());
}
@Test
@@ -89,6 +92,5 @@ public class GrpcActorServiceManagerTest {
Exception exception = new Exception("something failed");
manager.onError(exception);
assertTrue(future.isCompletedExceptionally());
- assertTrue(future.isDone());
}
}