diff options
Diffstat (limited to 'models-interactions/model-actors/actor.vfc/src/test')
2 files changed, 12 insertions, 9 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java index 5fe4973ce..d8ba7e4e8 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java @@ -22,6 +22,7 @@ package org.onap.policy.controlloop.actor.vfc; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.util.concurrent.CompletableFuture; import org.apache.commons.lang3.tuple.Pair; @@ -33,6 +34,7 @@ import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.vfc.VfcRequest; +import org.onap.policy.vfc.VfcResponse; public class RestartTest extends BasicVfcOperation { private Restart restartOper; @@ -72,6 +74,7 @@ public class RestartTest extends BasicVfcOperation { outcome = restartOper.start().get(); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertTrue(outcome.getResponse() instanceof VfcResponse); } @Test diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java index 4d98b97c9..0b58fd4a3 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java @@ -82,30 +82,30 @@ public class VfcOperationTest extends BasicVfcOperation { response.setResponseDescriptor(new VfcResponseDescriptor()); response.setJobId("sampleJobId"); + + // null status CompletableFuture<OperationOutcome> future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response); assertFalse(future2.isDone()); - // assertSame(outcome, future2.get()); TODO Hanging - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); response.getResponseDescriptor().setStatus("FinisHeD"); future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response); assertTrue(future2.isDone()); assertSame(outcome, future2.get()); assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertSame(response, outcome.getResponse()); + // failed response.getResponseDescriptor().setStatus("eRRor"); future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response); assertTrue(future2.isDone()); assertSame(outcome, future2.get()); assertEquals(PolicyResult.FAILURE, outcome.getResult()); + assertSame(response, outcome.getResponse()); - // failed - /* - * response.getResponseDescriptor().setStatus("anything but finished"); future2 = - * oper.postProcessResponse(outcome, PATH, rawResponse, response); - * assertTrue(future2.isDone()); assertSame(outcome, future2.get()); - * assertEquals(PolicyResult.FAILURE, outcome.getResult()); - */ + // unfinished + response.getResponseDescriptor().setStatus("anything but finished"); + future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response); + assertFalse(future2.isDone()); } @Test |