From 770e374bc2e4ba814bb0e59eadf0f9fe2d5291e5 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 27 May 2020 10:49:39 -0400 Subject: 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 --- .../policy/controlloop/actor/appclcm/AppcLcmOperationTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'models-interactions/model-actors/actor.appclcm/src/test/java') diff --git a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java index b2a44af53..c5ec58acd 100644 --- a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java +++ b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java @@ -25,6 +25,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; 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 static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -127,6 +128,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { outcome = oper.start().get(); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertTrue(outcome.getResponse() instanceof AppcLcmDmaapWrapper); } @Test @@ -163,7 +165,8 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { assertTrue(executor.runAll(100)); assertTrue(future2.isDone()); - assertEquals(PolicyResult.SUCCESS, future2.get().getResult()); + outcome = future2.get(); + assertEquals(PolicyResult.SUCCESS, outcome.getResult()); } @Test @@ -258,21 +261,25 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { oper.setOutcome(outcome, PolicyResult.SUCCESS, response); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); assertEquals(MY_MESSAGE, outcome.getMessage()); + assertSame(response, outcome.getResponse()); // failure oper.setOutcome(outcome, PolicyResult.FAILURE, response); assertEquals(PolicyResult.FAILURE, outcome.getResult()); assertEquals(MY_MESSAGE, outcome.getMessage()); + assertSame(response, outcome.getResponse()); // null message response.getBody().getOutput().getStatus().setMessage(null); oper.setOutcome(outcome, PolicyResult.SUCCESS, response); assertEquals(ControlLoopOperation.SUCCESS_MSG, outcome.getMessage()); + assertSame(response, outcome.getResponse()); // null status response.getBody().getOutput().setStatus(null); oper.setOutcome(outcome, PolicyResult.SUCCESS, response); assertEquals(ControlLoopOperation.SUCCESS_MSG, outcome.getMessage()); + assertSame(response, outcome.getResponse()); } @Test -- cgit 1.2.3-korg