From 951196b4e0d4c64403f186693c2d1c53e25df3b1 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Tue, 3 Jan 2023 10:48:36 +0000 Subject: Refactor Post compositions to create and update ACM definitions Issue-ID: POLICY-4492 Change-Id: Ica3885c7e2a048500a86abc194624ac22efd6bc2 Signed-off-by: FrancescoFioraEst --- .../runtime/commissioning/rest/CommissioningControllerTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime-acm/src/test/java/org/onap') diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java index da43b1fb2..c84d7ea80 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java @@ -29,12 +29,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVICE_TEMPLATE_YAML; import java.util.HashMap; +import java.util.Map; import java.util.UUID; import javax.ws.rs.client.Entity; import javax.ws.rs.core.Response; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.policy.clamp.acm.runtime.instantiation.InstantiationUtils; @@ -128,7 +128,6 @@ class CommissioningControllerTest extends CommonRestController { } } - @Disabled @Test void testUpdate() { var toscaDataType = new ToscaDataType(); @@ -143,8 +142,9 @@ class CommissioningControllerTest extends CommonRestController { var compositionId = createEntryInDB("forUpdate"); var serviceTemplateUpdate = new ToscaServiceTemplate(serviceTemplate); serviceTemplateUpdate.getDataTypes().put(toscaDataType.getName(), toscaDataType); - var invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "/" + compositionId); - var resp = invocationBuilder.put(Entity.json(serviceTemplateUpdate)); + serviceTemplateUpdate.setMetadata(Map.of("compositionId", compositionId)); + var invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT); + var resp = invocationBuilder.post(Entity.json(serviceTemplateUpdate)); assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); var commissioningResponse = resp.readEntity(CommissioningResponse.class); assertNotNull(commissioningResponse); -- cgit 1.2.3-korg