diff options
Diffstat (limited to 'models-interactions/model-actors/actor.guard')
2 files changed, 15 insertions, 15 deletions
diff --git a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java index 032a0c179..d9ec3ab2c 100644 --- a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java +++ b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java @@ -31,11 +31,11 @@ import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType; import org.onap.policy.controlloop.actorserviceprovider.CallbackManager; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation; import org.onap.policy.controlloop.actorserviceprovider.impl.OperationPartial; import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; -import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; import org.slf4j.Logger; @@ -150,15 +150,15 @@ public class DecisionOperation extends HttpOperation<DecisionResponse> { // determine the result String status = response.getStatus(); if (status == null) { - outcome.setResult(PolicyResult.FAILURE); + outcome.setResult(OperationResult.FAILURE); outcome.setMessage("response contains no status"); return CompletableFuture.completedFuture(outcome); } if (PERMIT.equalsIgnoreCase(status) || INDETERMINATE.equalsIgnoreCase(status)) { - outcome.setResult(PolicyResult.SUCCESS); + outcome.setResult(OperationResult.SUCCESS); } else { - outcome.setResult(PolicyResult.FAILURE); + outcome.setResult(OperationResult.FAILURE); } // set the message diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java index ac6d6c8e3..5502ec6aa 100644 --- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java +++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java @@ -49,8 +49,8 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInst import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.controlloop.actor.test.BasicHttpOperation; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.Util; -import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; import org.onap.policy.simulators.GuardSimulatorJaxRs; @@ -121,7 +121,7 @@ public class DecisionOperationTest extends BasicHttpOperation { oper = new DecisionOperation(params, config); outcome = oper.start().get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertTrue(outcome.getResponse() instanceof DecisionResponse); } @@ -138,7 +138,7 @@ public class DecisionOperationTest extends BasicHttpOperation { oper = new DecisionOperation(params, config); outcome = oper.start().get(); - assertEquals(PolicyResult.FAILURE, outcome.getResult()); + assertEquals(OperationResult.FAILURE, outcome.getResult()); assertTrue(outcome.getResponse() instanceof DecisionResponse); } @@ -170,7 +170,7 @@ public class DecisionOperationTest extends BasicHttpOperation { assertTrue(future2.isDone()); outcome = future2.get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertEquals(resp, outcome.getResponse()); assertNotNull(oper.getSubRequestId()); @@ -194,7 +194,7 @@ public class DecisionOperationTest extends BasicHttpOperation { assertTrue(future2.isDone()); outcome = future2.get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertNull(outcome.getResponse()); // ensure callbacks were invoked @@ -237,26 +237,26 @@ public class DecisionOperationTest extends BasicHttpOperation { // null status response.setStatus(null); - verifyOutcome(response, PolicyResult.FAILURE, "response contains no status"); + verifyOutcome(response, OperationResult.FAILURE, "response contains no status"); // permit, mixed case response.setStatus("peRmit"); - verifyOutcome(response, PolicyResult.SUCCESS, "peRmit"); + verifyOutcome(response, OperationResult.SUCCESS, "peRmit"); // indeterminate, mixed case response.setStatus("inDETerminate"); - verifyOutcome(response, PolicyResult.SUCCESS, "inDETerminate"); + verifyOutcome(response, OperationResult.SUCCESS, "inDETerminate"); // deny, mixed case response.setStatus("deNY"); - verifyOutcome(response, PolicyResult.FAILURE, "deNY"); + verifyOutcome(response, OperationResult.FAILURE, "deNY"); // unknown status response.setStatus("unknown"); - verifyOutcome(response, PolicyResult.FAILURE, "unknown"); + verifyOutcome(response, OperationResult.FAILURE, "unknown"); } - private void verifyOutcome(DecisionResponse response, PolicyResult expectedResult, String expectedMessage) { + private void verifyOutcome(DecisionResponse response, OperationResult expectedResult, String expectedMessage) { oper.postProcessResponse(outcome, BASE_URI, rawResponse, response); assertEquals(expectedResult, outcome.getResult()); assertEquals(expectedMessage, outcome.getMessage()); |