diff options
author | Jim Hahn <jrh3@att.com> | 2020-05-27 10:49:39 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-05-27 16:31:35 -0400 |
commit | 770e374bc2e4ba814bb0e59eadf0f9fe2d5291e5 (patch) | |
tree | d9ad1100fbb13b468865474a3450700b1b5c9f52 /models-interactions/model-actors/actor.so/src/test | |
parent | ddd400dc81f6bdabc76924cf904af540aa912ca2 (diff) |
Include response in OperationOutcome
Added the response field and modified the actors to populate it.
Issue-ID: POLICY-2592
Change-Id: I24487b6fbc23b69bde4a95acd470864d8231c49d
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.so/src/test')
3 files changed, 15 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java index 644521869..9e72c8aaf 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java @@ -176,6 +176,7 @@ public class SoOperationTest extends BasicSoOperation { assertSame(outcome, future2.get()); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); assertNotNull(oper.getSubRequestId()); + assertSame(response, outcome.getResponse()); // failed oper.generateSubRequestId(2); @@ -186,6 +187,7 @@ public class SoOperationTest extends BasicSoOperation { assertSame(outcome, future2.get()); assertEquals(PolicyResult.FAILURE, outcome.getResult()); assertNotNull(oper.getSubRequestId()); + assertSame(response, outcome.getResponse()); // no request id in the response oper.generateSubRequestId(2); @@ -291,6 +293,7 @@ public class SoOperationTest extends BasicSoOperation { assertEquals(PolicyResult.SUCCESS, outcome.getResult()); assertEquals("200 " + ControlLoopOperation.SUCCESS_MSG, outcome.getMessage()); + assertSame(response, outcome.getResponse()); // failure case when(rawResponse.getStatus()).thenReturn(500); @@ -298,6 +301,7 @@ public class SoOperationTest extends BasicSoOperation { assertEquals(PolicyResult.FAILURE, outcome.getResult()); assertEquals("500 " + ControlLoopOperation.FAILED_MSG, outcome.getMessage()); + assertSame(response, outcome.getResponse()); } @Test diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java index def107441..2b3e1163b 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java @@ -53,6 +53,7 @@ import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.so.SoRequest; +import org.onap.policy.so.SoResponse; public class VfModuleCreateTest extends BasicSoOperation { private static final String MODEL_NAME2 = "my-model-name-B"; @@ -96,6 +97,7 @@ public class VfModuleCreateTest extends BasicSoOperation { outcome = oper.start().get(); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertTrue(outcome.getResponse() instanceof SoResponse); } @Test @@ -187,6 +189,10 @@ public class VfModuleCreateTest extends BasicSoOperation { outcome = future2.get(5, TimeUnit.SECONDS); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + SoResponse resp = outcome.getResponse(); + assertNotNull(resp); + assertEquals(REQ_ID.toString(), resp.getRequestReferences().getRequestId()); + assertEquals(origCount + 1, oper.getVfCount()); } diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java index 0ec1a1df0..86242f042 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java @@ -130,6 +130,7 @@ public class VfModuleDeleteTest extends BasicSoOperation { outcome = oper.start().get(); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertTrue(outcome.getResponse() instanceof SoResponse); } @Test @@ -219,6 +220,10 @@ public class VfModuleDeleteTest extends BasicSoOperation { outcome = future2.get(5, TimeUnit.SECONDS); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + SoResponse resp = outcome.getResponse(); + assertNotNull(resp); + assertEquals(REQ_ID.toString(), resp.getRequestReferences().getRequestId()); + assertEquals(origCount - 1, oper.getVfCount()); } |