aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-controlloop/src/test/java
diff options
context:
space:
mode:
authorbrunomilitzer <bruno.militzer@est.tech>2021-12-09 15:28:53 +0000
committerbrunomilitzer <bruno.militzer@est.tech>2021-12-09 15:29:02 +0000
commit68d15b4d0241f03790bb0f5949e1f4abdeada428 (patch)
treef94ec4928e0248a89d2d2761feb5119de94127a6 /runtime-controlloop/src/test/java
parent50851a5ef93cbb2a92119db532dc813214752456 (diff)
Added CreateInstanceProperties JUnit Tests
Issue-Id: POLICY-3564 Change-Id: Ic7b7f3debc9712419aca213f43dd4bf78e3c07c7 Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
Diffstat (limited to 'runtime-controlloop/src/test/java')
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/rest/InstantiationControllerTest.java17
1 files changed, 17 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 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
@@ -314,6 +314,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);
Response resp = invocationBuilder.post(Entity.json(serviceTemplate));