use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class SniroHomingV1IT method testHoming_success_2AR1Vnf.
@Test
public void testHoming_success_2AR1Vnf() throws Exception {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
injectWorkflowMessages(callbacks, "sniro");
waitForProcessEnd(businessKey, 10000);
// Get Variables
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition");
String expectedSniroRequest = (String) getVariableFromHistory(businessKey, "sniroRequest");
Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
HomingSolution resourceARHoming = resourceAR.getHomingSolution();
Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
HomingSolution resourceARHoming2 = resourceAR2.getHomingSolution();
Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
HomingSolution resourceVNFHoming = resourceVNF.getHomingSolution();
String resourceARHomingString = resourceARHoming.toString();
resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
String resourceARHoming2String = resourceARHoming2.toString();
resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
String resourceVNFHomingString = resourceVNFHoming.toString();
resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
expectedSniroRequest = expectedSniroRequest.replaceAll("\\s+", "");
assertNull(workflowException);
assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01", "aic", "dfwtx", "KDTNJ01", "3.0", "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"", "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""), resourceARHomingString);
assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2", "aic", "testCloudRegionId2", "testAicClli2", "3.0", null, null), resourceARHoming2String);
assertEquals(homingSolutionCloud("cloud", "", "", "aic", "testCloudRegionId3", "testAicClli3", "3.0", "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"", "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""), resourceVNFHomingString);
assertEquals(verifySniroRequest(), expectedSniroRequest);
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class SniroHomingV1IT method testHoming_success_existingLicense.
@Test
public void testHoming_success_existingLicense() throws Exception {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<String, Object>();
setVariablesExistingLicense(variables);
invokeSubProcess("Homing", businessKey, variables);
injectWorkflowMessages(callbacks, "sniro");
waitForProcessEnd(businessKey, 10000);
// Get Variables
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition");
String sniroRequest = (String) getVariableFromHistory(businessKey, "sniroRequest");
Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
HomingSolution resourceARHoming = resourceAR.getHomingSolution();
Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
HomingSolution resourceARHoming2 = resourceAR2.getHomingSolution();
Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
HomingSolution resourceVNFHoming = resourceVNF.getHomingSolution();
String resourceARHomingString = resourceARHoming.toString();
resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
String resourceARHoming2String = resourceARHoming2.toString();
resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
String resourceVNFHomingString = resourceVNFHoming.toString();
resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
sniroRequest = sniroRequest.replaceAll("\\s+", "");
assertNull(workflowException);
assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01", "aic", "dfwtx", "KDTNJ01", "3.0", "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"", "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""), resourceARHomingString);
assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2", "aic", "testCloudRegionId2", "testAicClli2", "3.0", null, null), resourceARHoming2String);
assertEquals(homingSolutionCloud("cloud", "", "", "aic", "testCloudRegionId3", "testAicClli3", "3.0", "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"", "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""), resourceVNFHomingString);
assertEquals(verifySniroRequest_existingLicense(), sniroRequest);
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class SniroHomingV1IT method testHoming_error_sniroNoSolution.
@Test
public void testHoming_error_sniroNoSolution() throws Exception {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
injectWorkflowMessages(callbacks, "sniroNoSol");
waitForProcessEnd(businessKey, 10000);
// Get Variables
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
assertEquals("WorkflowException[processKey=Homing,errorCode=400,errorMessage=No solution found for plan 08e1b8cf-144a-4bac-b293-d5e2eedc97e8]", workflowException.toString());
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class SniroHomingV1IT method testHoming_success_2AR1Vnf2Net.
@Test
public void testHoming_success_2AR1Vnf2Net() throws Exception {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
setVariables2(variables);
invokeSubProcess("Homing", businessKey, variables);
injectWorkflowMessages(callbacks, "sniro2");
waitForProcessEnd(businessKey, 10000);
// Get Variables
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition");
String expectedSniroRequest = (String) getVariableFromHistory(businessKey, "sniroRequest");
Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
HomingSolution resourceARHoming = resourceAR.getHomingSolution();
Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
HomingSolution resourceARHoming2 = resourceAR2.getHomingSolution();
Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
HomingSolution resourceVNFHoming = resourceVNF.getHomingSolution();
Resource resourceNet = serviceDecompositionExp.getServiceResource("testResourceIdNet");
HomingSolution resourceNetHoming = resourceNet.getHomingSolution();
Resource resourceNet2 = serviceDecompositionExp.getServiceResource("testResourceIdNet2");
HomingSolution resourceNetHoming2 = resourceNet2.getHomingSolution();
String resourceARHomingString = resourceARHoming.toString();
resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
String resourceARHoming2String = resourceARHoming2.toString();
resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
String resourceVNFHomingString = resourceVNFHoming.toString();
resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
String resourceNetHomingString = resourceNetHoming.toString();
resourceNetHomingString = resourceNetHomingString.replaceAll("\\s+", " ");
String resourceNetHoming2String = resourceNetHoming2.toString();
resourceNetHoming2String = resourceNetHoming2String.replaceAll("\\s+", " ");
expectedSniroRequest = expectedSniroRequest.replaceAll("\\s+", "");
assertNull(workflowException);
assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01", "aic", "dfwtx", "KDTNJ01", "3.0", "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"", "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""), resourceARHomingString);
assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2", "aic", "testCloudRegionId2", "testAicClli2", "3.0", null, null), resourceARHoming2String);
assertEquals(homingSolutionCloud("cloud", "", "", "aic", "testCloudRegionId3", "testAicClli3", "3.0", "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"", "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""), resourceVNFHomingString);
assertEquals(homingSolutionService("service", "testServiceInstanceIdNet", "testVnfHostNameNet", "aic", "testCloudRegionIdNet", "testAicClliNet", "3.0", null, null), resourceNetHomingString);
assertEquals(homingSolutionCloud("cloud", "", "", "aic", "testCloudRegionIdNet2", "testAicClliNet2", "3.0", "\"f1d563e8-e714-4393-8f99-cc480144a05n\", \"j1d563e8-e714-4393-8f99-cc480144a05n\"", "\"s1d563e8-e714-4393-8f99-cc480144a05n\", \"b1d563e8-e714-4393-8f99-cc480144a05n\""), resourceNetHoming2String);
assertEquals(verifySniroRequest(), expectedSniroRequest);
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class UpdateAAIGenericVnfIT method personaMismatch.
/**
* Test the happy path through the flow.
*/
@Test
public void personaMismatch() throws IOException {
logStart();
String updateAAIGenericVnfRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIGenericVnfRequest.xml");
updateAAIGenericVnfRequest = updateAAIGenericVnfRequest.replaceFirst("introvert", "extrovert");
MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("isDebugLogEnabled", "true");
variables.put("UpdateAAIGenericVnfRequest", updateAAIGenericVnfRequest);
invokeSubProcess("UpdateAAIGenericVnf", businessKey, variables);
Assert.assertTrue(isProcessEnded(businessKey));
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
logger.debug("Workflow Exception: {}", workflowException);
Assert.assertNotNull(workflowException);
logEnd();
}
Aggregations