use of org.onap.so.bpmn.core.domain.ServiceDecomposition in project so by onap.
the class OofHomingTestIT method testHoming_success_existingLicense.
@Test
public void testHoming_success_existingLicense() throws Exception {
mockOof(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 oofRequest = (String) getVariableFromHistory(businessKey, "sniroRequest");
Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
HomingSolution resourceARHoming = (HomingSolution) resourceAR.getHomingSolution();
Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
HomingSolution resourceARHoming2 = (HomingSolution) resourceAR2.getHomingSolution();
Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
HomingSolution resourceVNFHoming = (HomingSolution) 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+", " ");
oofRequest = oofRequest.replaceAll("\\s+", "");
assertNull(workflowException);
assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01", "aic", "dfwtx", "KDTNJ01", "\"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", resourceARHoming2.getVnf().getResourceId(), "aic", "testCloudRegionId2", null, null), resourceARHoming2String);
assertEquals(homingSolutionCloud("cloud", "aic", "testCloudRegionId3", false, "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"", "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""), resourceVNFHomingString);
assertEquals(verifyOofRequestExistingLicense(), oofRequest);
}
use of org.onap.so.bpmn.core.domain.ServiceDecomposition in project so by onap.
the class OofHomingTestIT method testHoming_success_2AR1Vnf.
@Test
public void testHoming_success_2AR1Vnf() throws Exception {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
injectWorkflowMessages(callbacks, "oof2");
waitForProcessEnd(businessKey, 10000);
// Get Variables
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition");
String expectedOofRequest = (String) getVariableFromHistory(businessKey, "oofRequest");
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+", " ");
expectedOofRequest = expectedOofRequest.replaceAll("\\s+", "");
assertNull(workflowException);
assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01", resourceARHoming.getVnf().getResourceId(), "aic", "dfwtx", "\"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", resourceARHoming2.getVnf().getResourceId(), "aic", "testCloudRegionId2", null, null), resourceARHoming2String);
assertEquals(homingSolutionCloud("cloud", "aic", "testCloudRegionId3", true, "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"", "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""), resourceVNFHomingString);
assertEquals(verifyOofRequest(), expectedOofRequest);
}
Aggregations