From 68d15b4d0241f03790bb0f5949e1f4abdeada428 Mon Sep 17 00:00:00 2001 From: brunomilitzer Date: Thu, 9 Dec 2021 15:28:53 +0000 Subject: Added CreateInstanceProperties JUnit Tests Issue-Id: POLICY-3564 Change-Id: Ic7b7f3debc9712419aca213f43dd4bf78e3c07c7 Signed-off-by: brunomilitzer --- .../instantiation/rest/InstantiationControllerTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'runtime-controlloop/src') 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 5d5f4fc55..9cc0195d9 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 @@ -313,6 +313,23 @@ class InstantiationControllerTest extends CommonRestController { } } + @Test + void testCreateInstanceProperties() throws Exception { + Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES); + Response resp = invocationBuilder.post(Entity.json(serviceTemplate)); + assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); + var instancePropertyList = resp.readEntity(InstancePropertiesResponse.class); + assertNull(instancePropertyList.getErrorDetails()); + var id = new ToscaConceptIdentifier(ID_NAME, ID_VERSION); + assertEquals(id, instancePropertyList.getAffectedInstanceProperties().get(0)); + + invocationBuilder = super.sendRequest(INSTANTIATION_ENDPOINT); + resp = invocationBuilder.get(); + assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); + var controlLoopsGet = resp.readEntity(ControlLoops.class); + assertThat(controlLoopsGet.getControlLoopList()).hasSize(1); + } + @Test void testDeleteInstanceProperties() throws Exception { Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES); -- cgit 1.2.3-korg