summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java920
1 files changed, 460 insertions, 460 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
index 0198395750..c20028a636 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
@@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- */
+ */
package org.openecomp.mso.bpmn.common;
@@ -52,439 +52,439 @@ import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
public class GenericGetServiceTest extends WorkflowTest {
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance() throws Exception{
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- assertEquals("true", successIndicator);
- assertEquals("true", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertNotNull(response);
- assertEquals(null, workflowException);
- }
-
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceSubscription() throws Exception{
-
- MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", "GenericFlows/getServiceSubscription.xml");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesSubscription(variables, "", null , "1604-MVM-26", "SDN-ETHERNET-INTERNET");
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
-
- assertEquals("true", successIndicator);
- assertEquals("true", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertNotNull(response);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance_byName() throws Exception{
-
- MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByName.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, null, "1604-MVM-26", null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("true", found);
- assertEquals("true", obtainUrl);
- assertEquals("true", byName);
- assertNotNull(response);
- assertEquals("200", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance_byId() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("true", found);
- assertEquals("true", obtainUrl);
- assertEquals("false", byName);
- assertNotNull(response);
- assertEquals("200", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance_404Response() throws Exception{
-
- MockGetServiceInstance_404("SDN-ETHERNET-INTERNET", "123456789", "MIS%2F1604%2F0026%2FSW_INTERNET");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceSubscription404() throws Exception{
- MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", 404);
-
- Map<String, String> variables = new HashMap<>();
- setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", "1604-MVM-26");
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertNotNull(response);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstanceByName404() throws Exception{
-
- MockNodeQueryServiceInstanceByName_404("1604-MVM-26");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "", "1604-MVM-26", null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("true", byName);
- assertEquals("404", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstanceById404() throws Exception{
-
- MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("false", byName);
- assertEquals("404", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstanceEmptyResponse() throws Exception{
-
- MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", " ");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstanceByNameEmpty() throws Exception{
- MockNodeQueryServiceInstanceByName("1604-MVM-26", "");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "", "1604-MVM-26", null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("true", byName);
- assertEquals("200", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstanceByIdEmpty() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS[%]2F1604[%]2F0026[%]2FSW_INTERNET", "");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("false", byName);
- assertEquals("200", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_error_serviceInstanceInvalidVariables() throws Exception{
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, null, null, "SDN-ETHERNET-INTERNET", null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
-
- String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Incoming serviceInstanceId and serviceInstanceName are null. ServiceInstanceId or ServiceInstanceName is required to Get a service-instance.]";
-
- assertEquals("false", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertEquals(expectedWorkflowException, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceSubscriptionInvalidVariables() throws Exception{
-
- Map<String, String> variables = new HashMap<>();
- setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
-
- String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Incoming ServiceType or GlobalCustomerId is null. These variables are required to Get a service-subscription.]";
-
-
- assertEquals("false", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertEquals(expectedWorkflowException, workflowException);
- }
-
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_error_serviceInstance_getSIBadResponse() throws Exception{
-
- MockGetServiceInstance_500("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "123456789");
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstance() throws Exception {
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ assertEquals("true", successIndicator);
+ assertEquals("true", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertNotNull(response);
+ assertEquals(null, workflowException);
+ }
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceSubscription() throws Exception {
- assertEquals("false", successIndicator);
- assertEquals("false", found);
- assertEquals("false", obtainUrl);
- assertEquals("false", byName);
- assertEquals(expectedWorkflowException, workflowException);
- }
+ MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", "GenericFlows/getServiceSubscription.xml");
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_error_serviceInstance_getUrlByIdBadResponse() throws Exception{
+ Map<String, String> variables = new HashMap<>();
+ setVariablesSubscription(variables, "", null, "1604-MVM-26", "SDN-ETHERNET-INTERNET");
- MockNodeQueryServiceInstanceById_500("MIS%2F1604%2F0026%2FSW_INTERNET");
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ assertEquals("true", successIndicator);
+ assertEquals("true", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertNotNull(response);
+ assertEquals(null, workflowException);
+ }
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstance_byName() throws Exception {
- String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+ MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByName.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- assertEquals("false", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("false", byName);
- assertEquals("500", siUrlResponseCode);
- assertEquals(expectedWorkflowException, workflowException);
- }
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, null, "1604-MVM-26", null, null);
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_error_serviceInstance_getUrlByNameBadResponse() throws Exception{
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
- MockNodeQueryServiceInstanceByName_500("1604-MVM-26");
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("true", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("true", byName);
+ assertNotNull(response);
+ assertEquals("200", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, null, "1604-MVM-26", null, null);
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstance_byId() throws Exception {
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
- String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
- String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
- assertEquals("false", successIndicator);
- assertEquals("false", found);
- assertEquals("true", obtainUrl);
- assertEquals("true", byName);
- assertEquals("500", siUrlResponseCode);
- assertEquals(expectedWorkflowException, workflowException);
- }
+ assertEquals("true", successIndicator);
+ assertEquals("true", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("false", byName);
+ assertNotNull(response);
+ assertEquals("200", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
@Test
@Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance_byNameServicePresent() throws Exception{
+ public void testGenericGetService_success_serviceInstance_404Response() throws Exception {
+
+ MockGetServiceInstance_404("SDN-ETHERNET-INTERNET", "123456789", "MIS%2F1604%2F0026%2FSW_INTERNET");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceSubscription404() throws Exception {
+ MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", 404);
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", "1604-MVM-26");
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertNotNull(response);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstanceByName404() throws Exception {
+
+ MockNodeQueryServiceInstanceByName_404("1604-MVM-26");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "", "1604-MVM-26", null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("true", byName);
+ assertEquals("404", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstanceById404() throws Exception {
+
+ MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals("404", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstanceEmptyResponse() throws Exception {
+
+ MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", " ");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstanceByNameEmpty() throws Exception {
+ MockNodeQueryServiceInstanceByName("1604-MVM-26", "");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "", "1604-MVM-26", null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("true", byName);
+ assertEquals("200", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstanceByIdEmpty() throws Exception {
+
+ MockNodeQueryServiceInstanceById("MIS[%]2F1604[%]2F0026[%]2FSW_INTERNET", "");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals("200", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
+
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_error_serviceInstanceInvalidVariables() throws Exception {
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, null, null, "SDN-ETHERNET-INTERNET", null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+
+ String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Incoming serviceInstanceId and serviceInstanceName are null. ServiceInstanceId or ServiceInstanceName is required to Get a service-instance.]";
+
+ assertEquals("false", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals(expectedWorkflowException, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceSubscriptionInvalidVariables() throws Exception {
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+
+ String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Incoming ServiceType or GlobalCustomerId is null. These variables are required to Get a service-subscription.]";
+
+
+ assertEquals("false", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals(expectedWorkflowException, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_error_serviceInstance_getSIBadResponse() throws Exception {
+
+ MockGetServiceInstance_500("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "123456789");
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+
+ String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+
+ assertEquals("false", successIndicator);
+ assertEquals("false", found);
+ assertEquals("false", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals(expectedWorkflowException, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_error_serviceInstance_getUrlByIdBadResponse() throws Exception {
+
+ MockNodeQueryServiceInstanceById_500("MIS%2F1604%2F0026%2FSW_INTERNET");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_genericQueryResponseCode");
+
+ String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+
+ assertEquals("false", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("false", byName);
+ assertEquals("500", siUrlResponseCode);
+ assertEquals(expectedWorkflowException, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_error_serviceInstance_getUrlByNameBadResponse() throws Exception {
+
+ MockNodeQueryServiceInstanceByName_500("1604-MVM-26");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, null, "1604-MVM-26", null, null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");
+ String byName = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainServiceInstanceUrlByName");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+
+ String expectedWorkflowException = "WorkflowException[processKey=GenericGetService,errorCode=500,errorMessage=Received a bad response from AAI]";
+
+ assertEquals("false", successIndicator);
+ assertEquals("false", found);
+ assertEquals("true", obtainUrl);
+ assertEquals("true", byName);
+ assertEquals("500", siUrlResponseCode);
+ assertEquals(expectedWorkflowException, workflowException);
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstance_byNameServicePresent() throws Exception {
MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByNameMultiCustomer.xml");
MockGetServiceInstance("XyCorporation", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
@@ -504,57 +504,57 @@ public class GenericGetServiceTest extends WorkflowTest {
assertEquals("true", successIndicator);
assertEquals("true", found);
- assertNotNull(resourceLink);
+ assertNotNull(resourceLink);
assertNotNull(response);
assertEquals("200", siUrlResponseCode);
assertEquals(null, workflowException);
}
- @Test
- @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
- public void testGenericGetService_success_serviceInstance_byNameServiceNotPresent() throws Exception{
-
- MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByNameMultiCustomer.xml");
- MockGetServiceInstance("CorporationNotPresent", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
-
- Map<String, String> variables = new HashMap<>();
- setVariablesInstance(variables, null, "1604-MVM-26", "CorporationNotPresent", null);
-
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-
- String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
- String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
- String resourceLink = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_resourceLink");
- String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
- String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
-
- assertEquals("true", successIndicator);
- assertEquals("false", found);
- assertEquals(null, resourceLink);
- assertEquals(" ", response);
- assertEquals("200", siUrlResponseCode);
- assertEquals(null, workflowException);
- }
-
- private void setVariablesInstance(Map<String, String> variables, String siId, String siName, String globalCustId, String serviceType) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("GENGS_serviceInstanceId", siId);
- variables.put("GENGS_serviceInstanceName", siName);
- variables.put("GENGS_globalCustomerId",globalCustId);
- variables.put("GENGS_serviceType", serviceType);
- variables.put("GENGS_type", "service-instance");
- }
-
- private void setVariablesSubscription(Map<String, String> variables, String siId, String siName, String globalCustId, String serviceType) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("GENGS_serviceInstanceId", siId);
- variables.put("GENGS_serviceInstanceName", siName);
- variables.put("GENGS_globalCustomerId",globalCustId);
- variables.put("GENGS_serviceType", serviceType);
- variables.put("GENGS_type", "service-subscription");
- }
+ @Test
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn"})
+ public void testGenericGetService_success_serviceInstance_byNameServiceNotPresent() throws Exception {
+
+ MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByNameMultiCustomer.xml");
+ MockGetServiceInstance("CorporationNotPresent", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+
+ Map<String, String> variables = new HashMap<>();
+ setVariablesInstance(variables, null, "1604-MVM-26", "CorporationNotPresent", null);
+
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");
+ String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");
+ String resourceLink = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_resourceLink");
+ String response = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "WorkflowException");
+ String siUrlResponseCode = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainSIUrlResponseCode");
+
+ assertEquals("true", successIndicator);
+ assertEquals("false", found);
+ assertEquals(null, resourceLink);
+ assertEquals(" ", response);
+ assertEquals("200", siUrlResponseCode);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesInstance(Map<String, String> variables, String siId, String siName, String globalCustId, String serviceType) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("GENGS_serviceInstanceId", siId);
+ variables.put("GENGS_serviceInstanceName", siName);
+ variables.put("GENGS_globalCustomerId", globalCustId);
+ variables.put("GENGS_serviceType", serviceType);
+ variables.put("GENGS_type", "service-instance");
+ }
+
+ private void setVariablesSubscription(Map<String, String> variables, String siId, String siName, String globalCustId, String serviceType) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("GENGS_serviceInstanceId", siId);
+ variables.put("GENGS_serviceInstanceName", siName);
+ variables.put("GENGS_globalCustomerId", globalCustId);
+ variables.put("GENGS_serviceType", serviceType);
+ variables.put("GENGS_type", "service-subscription");
+ }
}