diff options
author | Jim Hahn <jrh3@att.com> | 2020-04-08 12:37:20 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-04-08 14:36:45 -0400 |
commit | df6d6bb862fb0af49a8873479f9e3b609553deca (patch) | |
tree | bc5ef9a08ccb0c0a4a27951c56c5b42350d297ea /models-interactions/model-actors/actorServiceProvider | |
parent | 9b3ff5f270572a6760ff07dda9577cdadb53b088 (diff) |
SDNR Actor enhancements
Made the following changes:
- Enhanced SDNR Actor to support any operation name specified within
the policy, constructing the same request, but passing a different
"RPC name" and "Action" in the request.
- Added ControlLoopResponse to OperationOutcome
- Modified SDNR Actor to populate ControlLoopResponse
Issue-ID: POLICY-2468
Change-Id: I50ee0674077d975f3cd211454656edc47d78520f
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider')
2 files changed, 13 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java index d8db70619..e2d94b3b3 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java @@ -25,6 +25,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.NonNull; import org.onap.policy.controlloop.ControlLoopOperation; +import org.onap.policy.controlloop.ControlLoopResponse; import org.onap.policy.controlloop.policy.PolicyResult; /** @@ -42,6 +43,7 @@ public class OperationOutcome { private PolicyResult result = PolicyResult.SUCCESS; private String message; private boolean finalOutcome; + private ControlLoopResponse controlLoopResponse; /** * Copy constructor. @@ -58,6 +60,7 @@ public class OperationOutcome { this.result = source.result; this.message = source.message; this.finalOutcome = source.finalOutcome; + this.controlLoopResponse = source.controlLoopResponse; } /** diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcomeTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcomeTest.java index 4e9728336..77d2253e1 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcomeTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcomeTest.java @@ -23,12 +23,14 @@ package org.onap.policy.controlloop.actorserviceprovider; 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.time.Instant; import org.junit.Before; import org.junit.Test; import org.onap.policy.controlloop.ControlLoopOperation; +import org.onap.policy.controlloop.ControlLoopResponse; import org.onap.policy.controlloop.policy.PolicyResult; public class OperationOutcomeTest { @@ -41,10 +43,16 @@ public class OperationOutcomeTest { private static final PolicyResult RESULT = PolicyResult.FAILURE_GUARD; private static final String MESSAGE = "my-message"; + private ControlLoopResponse response; private OperationOutcome outcome; + /** + * Sets up. + */ @Before public void setUp() { + response = new ControlLoopResponse(); + outcome = new OperationOutcome(); } @@ -62,6 +70,7 @@ public class OperationOutcomeTest { assertEquals(SUB_REQ_ID, outcome2.getSubRequestId()); assertEquals(RESULT, outcome2.getResult()); assertEquals(MESSAGE, outcome2.getMessage()); + assertSame(response, outcome2.getControlLoopResponse()); } @Test @@ -133,5 +142,6 @@ public class OperationOutcomeTest { outcome.setStart(START); outcome.setSubRequestId(SUB_REQ_ID); outcome.setTarget(TARGET); + outcome.setControlLoopResponse(response); } } |