summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appc
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.appc')
-rw-r--r--models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java2
-rw-r--r--models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java3
-rw-r--r--models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java2
3 files changed, 7 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java
index 75a4c9f58..14ab355bf 100644
--- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java
+++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java
@@ -171,6 +171,8 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request,
*/
@Override
public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, Response response) {
+ outcome.setResponse(response);
+
if (response.getStatus() == null || response.getStatus().getDescription() == null) {
return setOutcome(outcome, result);
}
diff --git a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
index 4c6477d93..b2d012a9f 100644
--- a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
+++ b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
@@ -212,6 +212,7 @@ public class AppcOperationTest extends BasicAppcOperation {
assertSame(outcome, oper.setOutcome(outcome, PolicyResult.SUCCESS, response));
assertEquals(PolicyResult.SUCCESS, outcome.getResult());
assertNotNull(outcome.getMessage());
+ assertSame(response, outcome.getResponse());
response.setStatus(status);
// null description
@@ -219,12 +220,14 @@ public class AppcOperationTest extends BasicAppcOperation {
assertSame(outcome, oper.setOutcome(outcome, PolicyResult.FAILURE, response));
assertEquals(PolicyResult.FAILURE, outcome.getResult());
assertNotNull(outcome.getMessage());
+ assertSame(response, outcome.getResponse());
status.setDescription(MY_DESCRIPTION);
for (PolicyResult result : PolicyResult.values()) {
assertSame(outcome, oper.setOutcome(outcome, result, response));
assertEquals(result, outcome.getResult());
assertEquals(MY_DESCRIPTION, outcome.getMessage());
+ assertSame(response, outcome.getResponse());
}
}
diff --git a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
index 4f4f506ce..0e29dd208 100644
--- a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
+++ b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
@@ -42,6 +42,7 @@ import org.junit.Test;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.appc.Request;
+import org.onap.policy.appc.Response;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.controlloop.ControlLoopEventContext;
@@ -108,6 +109,7 @@ public class ModifyConfigOperationTest extends BasicAppcOperation {
outcome = oper.start().get();
assertEquals(PolicyResult.SUCCESS, outcome.getResult());
+ assertTrue(outcome.getResponse() instanceof Response);
}
@Test