From b741e69ad9a60a128d1994a6fcf65f0b6aeee7ee Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Fri, 10 Sep 2021 15:38:07 +0100 Subject: Add Priming flag per controlloop This commit adds a Priming flag per controlloop which indicates whether a controlLoop is primed or deprimed. There is a rest end-point added to depict in GUI Issue-ID: POLICY-3577 Signed-off-by: Sirisha_Manchikanti Change-Id: Ie81a41505ab1eafda9515733e0b895421803ea8a --- .../instantiation/rest/InstantiationControllerTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime-controlloop/src/test/java') diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java index a6756eece..42e4ddee2 100644 --- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java +++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java @@ -36,6 +36,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoops; +import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.ControlLoopPrimedResponse; import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationCommand; import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationResponse; import org.onap.policy.clamp.controlloop.runtime.instantiation.ControlLoopInstantiationProvider; @@ -80,6 +81,8 @@ class InstantiationControllerTest extends CommonRestController { private static final String INSTANTIATION_COMMAND_ENDPOINT = "instantiation/command"; + private static final String PRIMING_ENDPOINT = "controlLoopPriming"; + private static ToscaServiceTemplate serviceTemplate = new ToscaServiceTemplate(); private static final YamlJsonTranslator yamlTranslator = new YamlJsonTranslator(); @@ -174,6 +177,13 @@ class InstantiationControllerTest extends CommonRestController { assertThat(controlLoopsFromDb.getControlLoopList()).hasSize(1); assertEquals(controlLoopFromRsc, controlLoopsFromDb.getControlLoopList().get(0)); } + + invocationBuilder = super.sendRequest(PRIMING_ENDPOINT + "?name=" + + "PMSHInstance0Create" + "&version=" + "1.0.1"); + Response rawresp = invocationBuilder.buildGet().invoke(); + assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); + ControlLoopPrimedResponse primResponse = rawresp.readEntity(ControlLoopPrimedResponse.class); + assertEquals(false, primResponse.getPrimedControlLoopsList().get(0).isPrimed()); } @Test -- cgit 1.2.3-korg