aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-01-03 10:48:36 +0000
committerFrancesco Fiora <francesco.fiora@est.tech>2023-01-04 09:54:47 +0000
commit951196b4e0d4c64403f186693c2d1c53e25df3b1 (patch)
treebdfbd91c858902522be7866081496e2f5e878db4 /runtime-acm/src/test
parentc6fb86de3dae6f26aec9813cd5ef4cc8d9268359 (diff)
Refactor Post compositions to create and update ACM definitions
Issue-ID: POLICY-4492 Change-Id: Ica3885c7e2a048500a86abc194624ac22efd6bc2 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/test')
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java8
1 files changed, 4 insertions, 4 deletions
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);