aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2022-11-14 10:49:34 +0000
committerFrancesco Fiora <francesco.fiora@est.tech>2022-11-14 14:45:18 +0000
commitc32d7926409b4c164e2a5097e7ba1bc4d766bd5b (patch)
treec0beffd2b72a7eb06db7eb0f9e3c687c24d1ded7 /runtime-acm/src/test
parentcfa51e6177b801fcf456390cdaea520b6378de39 (diff)
Remove redundant endpoints in ACM
Remove redundant endpoints in ACM not present in the new generated Api code. Issue-ID: POLICY-4453 Change-Id: I4b843c2637e934f8a29f71d8031bdfe903ff20dc 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.java41
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java57
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java182
3 files changed, 0 insertions, 280 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 0cc2036e7..f34e5eff0 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
@@ -30,7 +30,6 @@ import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVIC
import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_ST_TEMPLATE_YAML;
import java.util.List;
-import java.util.Map;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.Response;
@@ -45,7 +44,6 @@ import org.onap.policy.clamp.acm.runtime.instantiation.InstantiationUtils;
import org.onap.policy.clamp.acm.runtime.util.rest.CommonRestController;
import org.onap.policy.clamp.models.acm.messages.rest.commissioning.CommissioningResponse;
import org.onap.policy.clamp.models.acm.persistence.provider.ServiceTemplateProvider;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -142,22 +140,6 @@ class CommissioningControllerTest extends CommonRestController {
}
@Test
- void testQueryCommonOrInstanceProperties() throws Exception {
- createFullEntryInDbWithCommonProps();
-
- Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT
- + "/getCommonOrInstanceProperties?common=true");
- Response rawresp = invocationBuilder.buildGet().invoke();
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
-
- @SuppressWarnings("unchecked")
- Map<String, ToscaNodeTemplate> commonProperties = rawresp.readEntity(Map.class);
-
- assertNotNull(commonProperties);
- assertThat(commonProperties).hasSize(4);
- }
-
- @Test
void testCreateBadRequest() {
Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT);
Response resp = invocationBuilder.post(Entity.json("NotToscaServiceTempalte"));
@@ -209,29 +191,6 @@ class CommissioningControllerTest extends CommonRestController {
}
@Test
- void testQueryElementsBadRequest() throws Exception {
- createEntryInDB();
-
- // Call get elements with no info
- Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "/elements");
- Response resp = invocationBuilder.buildGet().invoke();
- assertEquals(Response.Status.NOT_ACCEPTABLE.getStatusCode(), resp.getStatus());
- }
-
- @Test
- void testQueryElements() throws Exception {
- createEntryInDB();
-
- Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "/elements"
- + "?name=org.onap.domain.pmsh.PMSHAutomationCompositionDefinition");
- Response rawresp = invocationBuilder.buildGet().invoke();
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
- List<?> entityList = rawresp.readEntity(List.class);
- assertNotNull(entityList);
- assertThat(entityList).hasSize(4);
- }
-
- @Test
void testDeleteBadRequest() throws Exception {
createEntryInDB();
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java
index b826eebbc..016ec6c5e 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java
@@ -23,17 +23,13 @@ package org.onap.policy.clamp.acm.runtime.instantiation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVICE_TEMPLATE_YAML;
import java.util.List;
import java.util.Optional;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.onap.policy.clamp.acm.runtime.commissioning.CommissioningProvider;
@@ -41,24 +37,19 @@ import org.onap.policy.clamp.acm.runtime.supervision.SupervisionHandler;
import org.onap.policy.clamp.acm.runtime.util.CommonTestData;
import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
-import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositions;
import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstantiationCommand;
import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstantiationResponse;
import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
/**
* Class to perform unit test of {@link AutomationCompositionInstantiationProvider}}.
*
*/
class AutomationCompositionInstantiationProviderTest {
- private static final String ID_NAME = "PMSH_Test_Instance";
- private static final String ID_VERSION = "1.2.3";
private static final String AC_INSTANTIATION_CREATE_JSON =
"src/test/resources/rest/acm/AutomationCompositions.json";
private static final String AC_INSTANTIATION_UPDATE_JSON =
@@ -89,54 +80,6 @@ class AutomationCompositionInstantiationProviderTest {
+ " {4}item \"AutomationComposition\" value \"org.onap.domain.PMSHAutomationCompositionDefinition\""
+ " INVALID, Commissioned automation composition definition not found\n";
- private static ToscaServiceTemplate serviceTemplate = new ToscaServiceTemplate();
-
- @BeforeAll
- public static void setUpBeforeClass() {
- serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
- }
-
- @Test
- void testInstanceResponse() throws Exception {
- var participantProvider = Mockito.mock(ParticipantProvider.class);
- var acProvider = mock(AutomationCompositionProvider.class);
- var supervisionHandler = mock(SupervisionHandler.class);
- var commissioningProvider = mock(CommissioningProvider.class);
-
- when(commissioningProvider.getAllToscaServiceTemplate()).thenReturn(List.of(serviceTemplate));
- when(commissioningProvider.getToscaServiceTemplate(ID_NAME, ID_VERSION)).thenReturn(serviceTemplate);
-
- var instantiationProvider = new AutomationCompositionInstantiationProvider(acProvider, commissioningProvider,
- supervisionHandler, participantProvider);
- var instancePropertyList = instantiationProvider.createInstanceProperties(serviceTemplate);
- assertNull(instancePropertyList.getErrorDetails());
- var id = new ToscaConceptIdentifier(ID_NAME, ID_VERSION);
- assertEquals(id, instancePropertyList.getAffectedInstanceProperties().get(0));
-
- AutomationCompositions automationCompositions =
- InstantiationUtils.getAutomationCompositionsFromResource(AC_INSTANTIATION_CREATE_JSON, "Crud");
- var automationComposition = automationCompositions.getAutomationCompositionList().get(0);
- automationComposition.setName(ID_NAME);
- automationComposition.setVersion(ID_VERSION);
- when(acProvider.getAutomationCompositions(ID_NAME, ID_VERSION)).thenReturn(List.of(automationComposition));
-
- var updatedInstancePropertyList = instantiationProvider.createInstanceProperties(serviceTemplate);
- assertNull(updatedInstancePropertyList.getErrorDetails());
- var updatedId = new ToscaConceptIdentifier(ID_NAME, ID_VERSION);
- assertEquals(updatedId, instancePropertyList.getAffectedInstanceProperties().get(0));
-
- var instanceOrderState = instantiationProvider.getInstantiationOrderState(ID_NAME, ID_VERSION);
- assertEquals(AutomationCompositionOrderedState.UNINITIALISED, instanceOrderState.getOrderedState());
- assertEquals(ID_NAME, instanceOrderState.getAutomationCompositionIdentifierList().get(0).getName());
-
- when(acProvider.findAutomationComposition(ID_NAME, ID_VERSION)).thenReturn(Optional.of(automationComposition));
- when(acProvider.deleteAutomationComposition(ID_NAME, ID_VERSION)).thenReturn(automationComposition);
-
- var instanceResponse = instantiationProvider.deleteInstanceProperties(ID_NAME, ID_VERSION);
- assertEquals(ID_NAME, instanceResponse.getAffectedAutomationCompositions().get(0).getName());
-
- }
-
@Test
void testInstantiationCrud() throws Exception {
var participantProvider = Mockito.mock(ParticipantProvider.class);
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java
index 35a3094cd..7cdc8a975 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java
@@ -23,7 +23,6 @@ package org.onap.policy.clamp.acm.runtime.instantiation.rest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVICE_TEMPLATE_YAML;
@@ -42,11 +41,7 @@ import org.onap.policy.clamp.acm.runtime.main.rest.InstantiationController;
import org.onap.policy.clamp.acm.runtime.util.CommonTestData;
import org.onap.policy.clamp.acm.runtime.util.rest.CommonRestController;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
-import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositions;
-import org.onap.policy.clamp.models.acm.messages.rest.instantiation.AutomationCompositionOrderStateResponse;
-import org.onap.policy.clamp.models.acm.messages.rest.instantiation.AutomationCompositionPrimedResponse;
-import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstancePropertiesResponse;
import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstantiationCommand;
import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstantiationResponse;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
@@ -83,9 +78,6 @@ class InstantiationControllerTest extends CommonRestController {
private static final String INSTANTIATION_ENDPOINT = "instantiation";
private static final String INSTANTIATION_COMMAND_ENDPOINT = "instantiation/command";
- private static final String PRIMING_ENDPOINT = "automationCompositionPriming";
- private static final String INSTANTIATION_PROPERTIES = "instanceProperties";
- private static final String INSTANTIATION_STATE = "instantiationState";
private static ToscaServiceTemplate serviceTemplate = new ToscaServiceTemplate();
@@ -185,14 +177,6 @@ class InstantiationControllerTest extends CommonRestController {
assertEquals(automationCompositionFromRsc,
automationCompositionsFromDb.getAutomationCompositionList().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());
- AutomationCompositionPrimedResponse primResponse =
- rawresp.readEntity(AutomationCompositionPrimedResponse.class);
- assertFalse(primResponse.getPrimedAutomationCompositionsList().get(0).isPrimed());
}
@Test
@@ -273,17 +257,6 @@ class InstantiationControllerTest extends CommonRestController {
}
@Test
- void testDelete_NoResultWithThisName() {
- Invocation.Builder invocationBuilder =
- super.sendRequest(INSTANTIATION_ENDPOINT + "?name=noResultWithThisName&version=1.0.1");
- Response resp = invocationBuilder.delete();
- assertEquals(Response.Status.NOT_FOUND.getStatusCode(), resp.getStatus());
- InstantiationResponse instResponse = resp.readEntity(InstantiationResponse.class);
- assertNotNull(instResponse.getErrorDetails());
- assertNull(instResponse.getAffectedAutomationCompositions());
- }
-
- @Test
void testDelete() throws Exception {
AutomationCompositions automationCompositionsFromRsc =
@@ -325,89 +298,6 @@ class InstantiationControllerTest extends CommonRestController {
}
@Test
- void testCreateInstanceProperties() {
- 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 automationCompositionsGet = resp.readEntity(AutomationCompositions.class);
- assertThat(automationCompositionsGet.getAutomationCompositionList()).hasSize(1);
- }
-
- @Test
- void testDeleteInstanceProperties() throws Exception {
- Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES);
- Response resp = invocationBuilder.post(Entity.json(serviceTemplate));
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
-
- invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES + "?name=" + ID_NAME + "&version=" + ID_VERSION);
- resp = invocationBuilder.delete();
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
- var instanceResponse = resp.readEntity(InstantiationResponse.class);
- assertEquals(ID_NAME, instanceResponse.getAffectedAutomationCompositions().get(0).getName());
- AutomationCompositions automationCompositionsGet =
- instantiationProvider.getAutomationCompositions(ID_NAME, ID_VERSION);
- assertThat(automationCompositionsGet.getAutomationCompositionList()).isEmpty();
- }
-
- @Test
- void testDeleteInstancePropertiesBadRequest() {
- Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES);
- Response resp = invocationBuilder.post(Entity.json(serviceTemplate));
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
-
- invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES + "?name=" + ID_NAME);
- resp = invocationBuilder.delete();
- assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), resp.getStatus());
- }
-
- @Test
- void testDeleteInstancePropertiesPassiveMode() throws Exception {
- Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES);
- Response resp = invocationBuilder.post(Entity.json(serviceTemplate));
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
-
- var automationCompositions =
- InstantiationUtils.getAutomationCompositionsFromResource(AC_INSTANTIATION_CREATE_JSON, "Command");
- instantiationProvider.createAutomationCompositions(automationCompositions);
-
- var participants = CommonTestData.createParticipants();
- for (var participant : participants) {
- participantProvider.saveParticipant(participant);
- }
-
- InstantiationCommand command =
- InstantiationUtils.getInstantiationCommandFromResource(AC_INSTANTIATION_CHANGE_STATE_JSON, "Command");
-
- invocationBuilder = super.sendRequest(INSTANTIATION_COMMAND_ENDPOINT);
- resp = invocationBuilder.put(Entity.json(command));
- assertEquals(Response.Status.ACCEPTED.getStatusCode(), resp.getStatus());
- InstantiationResponse instResponse = resp.readEntity(InstantiationResponse.class);
- InstantiationUtils.assertInstantiationResponse(instResponse, command);
-
- // check passive state on DB and delete properties
- for (ToscaConceptIdentifier toscaConceptIdentifier : command.getAutomationCompositionIdentifierList()) {
- AutomationCompositions automationCompositionsGet = instantiationProvider
- .getAutomationCompositions(toscaConceptIdentifier.getName(), toscaConceptIdentifier.getVersion());
- assertThat(automationCompositionsGet.getAutomationCompositionList()).hasSize(1);
- assertEquals(command.getOrderedState(),
- automationCompositionsGet.getAutomationCompositionList().get(0).getOrderedState());
-
- invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES + "?name=" + toscaConceptIdentifier.getName()
- + "&version=" + toscaConceptIdentifier.getVersion());
- resp = invocationBuilder.delete();
- assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), resp.getStatus());
- }
- }
-
- @Test
void testCommand_NotFound1() {
Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_COMMAND_ENDPOINT);
Response resp = invocationBuilder.put(Entity.json(new InstantiationCommand()));
@@ -455,78 +345,6 @@ class InstantiationControllerTest extends CommonRestController {
}
}
- @Test
- void testIntanceProperties() 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_STATE + "?name=" + ID_NAME + "&version=" + ID_VERSION);
- resp = invocationBuilder.buildGet().invoke();
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
- var instanceOrderState = resp.readEntity(AutomationCompositionOrderStateResponse.class);
- assertEquals(AutomationCompositionOrderedState.UNINITIALISED, instanceOrderState.getOrderedState());
- assertEquals(ID_NAME, instanceOrderState.getAutomationCompositionIdentifierList().get(0).getName());
- AutomationCompositions automationCompositionsGet =
- instantiationProvider.getAutomationCompositions(ID_NAME, ID_VERSION);
- assertThat(automationCompositionsGet.getAutomationCompositionList()).hasSize(1);
-
- invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES + "?name=" + ID_NAME + "&version=" + ID_VERSION);
- resp = invocationBuilder.delete();
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
- var instanceResponse = resp.readEntity(InstantiationResponse.class);
- assertEquals(ID_NAME, instanceResponse.getAffectedAutomationCompositions().get(0).getName());
- automationCompositionsGet = instantiationProvider.getAutomationCompositions(ID_NAME, ID_VERSION);
- assertThat(automationCompositionsGet.getAutomationCompositionList()).isEmpty();
- }
-
- @Test
- void testChangeOrderStateFromUninitializedPassiveMode() throws Exception {
- Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES);
- Response resp = invocationBuilder.post(Entity.json(serviceTemplate));
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
-
- var automationCompositions =
- InstantiationUtils.getAutomationCompositionsFromResource(AC_INSTANTIATION_CREATE_JSON, "CommandPassive");
- instantiationProvider.createAutomationCompositions(automationCompositions);
-
- var participants = CommonTestData.createParticipants();
- for (var participant : participants) {
- participantProvider.saveParticipant(participant);
- }
-
- InstantiationCommand command = InstantiationUtils
- .getInstantiationCommandFromResource(AC_INSTANTIATION_CHANGE_STATE_JSON, "CommandPassive");
-
- invocationBuilder = super.sendRequest(INSTANTIATION_COMMAND_ENDPOINT);
- resp = invocationBuilder.put(Entity.json(command));
- assertEquals(Response.Status.ACCEPTED.getStatusCode(), resp.getStatus());
- InstantiationResponse instResponse = resp.readEntity(InstantiationResponse.class);
- InstantiationUtils.assertInstantiationResponse(instResponse, command);
- }
-
- @Test
- void testChangeOrderStateWithoutRegisteredParticipants() throws Exception {
- Invocation.Builder invocationBuilder = super.sendRequest(INSTANTIATION_PROPERTIES);
- Response resp = invocationBuilder.post(Entity.json(serviceTemplate));
- assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
-
- var automationCompositions =
- InstantiationUtils.getAutomationCompositionsFromResource(AC_INSTANTIATION_CREATE_JSON, "CommandPassive");
- instantiationProvider.createAutomationCompositions(automationCompositions);
-
- InstantiationCommand command = InstantiationUtils
- .getInstantiationCommandFromResource(AC_INSTANTIATION_CHANGE_STATE_JSON, "CommandPassive");
-
- invocationBuilder = super.sendRequest(INSTANTIATION_COMMAND_ENDPOINT);
- resp = invocationBuilder.put(Entity.json(command));
- assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), resp.getStatus());
- }
-
private synchronized void deleteEntryInDB() throws Exception {
automationCompositionRepository.deleteAll();
var list = serviceTemplateProvider.getAllServiceTemplates();