diff options
author | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2021-09-10 15:38:07 +0100 |
---|---|---|
committer | Liam Fallon <liam.fallon@est.tech> | 2021-09-14 20:22:17 +0000 |
commit | b741e69ad9a60a128d1994a6fcf65f0b6aeee7ee (patch) | |
tree | 14fbc25e98d3fd8843712527c691c3f96b96b38d /runtime-controlloop/src/test | |
parent | 16f9b97bda8300b354b7d156c084f9869191415f (diff) |
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 <sirisha.manchikanti@est.tech>
Change-Id: Ie81a41505ab1eafda9515733e0b895421803ea8a
Diffstat (limited to 'runtime-controlloop/src/test')
-rw-r--r-- | runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
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 |