use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class VnfAdapterRestV1IT method testCreateVfModuleException.
@Test
public void testCreateVfModuleException() throws Exception {
logStart();
mockVNFPost(wireMockServer, "", 202, "vnfId");
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
String request = CREATE_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
invokeSubProcess("vnfAdapterRestV1", businessKey, variables);
injectVNFRestCallbacks(callbacks, "vfModuleException");
waitForProcessEnd(businessKey, 10000);
WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
assertNotNull(wfe);
logger.debug(wfe.toString());
String response = (String) getVariableFromHistory(businessKey, "WorkflowResponse");
logger.debug("Response:\n{}", response);
assertTrue(response.contains("<vfModuleException>"));
assertFalse((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
logEnd();
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class CreateAAIVfModuleIT method TestQueryGenericVnfFailure_5000.
@Test
public void TestQueryGenericVnfFailure_5000() {
new MockAAIGenericVnfSearch(wireMockServer);
MockAAICreateGenericVnf(wireMockServer);
MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("isDebugLogEnabled", "true");
variables.put("isVidRequest", "false");
variables.put("vnfName", "STMTN5MMSC23");
variables.put("serviceId", "00000000-0000-0000-0000-000000000000");
variables.put("personaModelId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
variables.put("personaModelVersion", "1.0");
variables.put("vfModuleName", "STMTN5MMSC23-MMSC::module-0-0");
variables.put("vfModuleModelName", "MMSC::module-0");
String processId = invokeSubProcess("CreateAAIVfModule", variables);
WorkflowException exception = BPMNUtil.getRawVariable(processEngine, "CreateAAIVfModule", "WorkflowException", processId);
Assert.assertEquals(500, exception.getErrorCode());
Assert.assertEquals(true, exception.getErrorMessage().contains("Error occurred attempting to query AAI"));
logger.debug(exception.getErrorMessage());
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class CreateAAIVfModuleIT method TestCreateVfModuleFailure_5000.
@Test
public void TestCreateVfModuleFailure_5000() {
new MockAAIGenericVnfSearch(wireMockServer);
MockAAICreateGenericVnf(wireMockServer);
MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled", "true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
variables.put("serviceId", "99999999-9999-9999-9999-999999999999");
variables.put("personaModelId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
variables.put("personaModelVersion", "1.0");
variables.put("vfModuleName", "STMTN5MMSC21-PCRF::module-1-0");
variables.put("vfModuleModelName", "STMTN5MMSC21-PCRF::model-1-0");
variables.put("mso-request-id", UUID.randomUUID().toString());
String processId = invokeSubProcess("CreateAAIVfModule", variables);
WorkflowException exception = BPMNUtil.getRawVariable(processEngine, "CreateAAIVfModule", "WorkflowException", processId);
Assert.assertEquals(5000, exception.getErrorCode());
Assert.assertEquals(true, exception.getErrorMessage().contains("<messageId>SVC3002</messageId>"));
logger.debug(exception.getErrorMessage());
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class CreateAAIVfModuleIT method TestCreateGenericVnfFailure_1002.
@Test
public void TestCreateGenericVnfFailure_1002() {
new MockAAIGenericVnfSearch(wireMockServer);
MockAAICreateGenericVnf(wireMockServer);
MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("isDebugLogEnabled", "true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "768073c7-f41f-4822-9323-b75962763d74");
variables.put("serviceId", "00000000-0000-0000-0000-000000000000");
variables.put("personaModelId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
variables.put("personaModelVersion", "1.0");
variables.put("vfModuleName", "STMTN5MMSC22-PCRF::module-1-0");
variables.put("vfModuleModelName", "PCRF::module-0");
String processId = invokeSubProcess("CreateAAIVfModule", variables);
WorkflowException exception = BPMNUtil.getRawVariable(processEngine, "CreateAAIVfModule", "WorkflowException", processId);
Assert.assertEquals(1002, exception.getErrorCode());
Assert.assertEquals(true, exception.getErrorMessage().contains("Generic VNF Not Found"));
logger.debug(exception.getErrorMessage());
}
use of org.onap.so.bpmn.core.WorkflowException in project so by onap.
the class DeleteAAIVfModuleIT method TestDeleteVfModuleFailure_1002_1.
@Test
public void TestDeleteVfModuleFailure_1002_1() {
// failure attempting to delete Base Module when not the last Vf Module
// vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c720, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a74
String request = "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL + " <request-info>" + EOL + " <action>DELETE_VF_MODULE</action>" + EOL + " <source>PORTAL</source>" + EOL + " </request-info>" + EOL + " <vnf-inputs>" + EOL + " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c720</vnf-id>" + EOL + " <vnf-name>STMTN5MMSC20</vnf-name>" + EOL + " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a74</vf-module-id>" + EOL + " <vf-module-name>STMTN5MMSC20-MMSC::module-0-0</vf-module-name>" + EOL + " </vnf-inputs>" + EOL + " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL + "</vnf-request>" + EOL;
new MockAAIGenericVnfSearch(wireMockServer);
new MockAAIDeleteGenericVnf(wireMockServer);
new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled", "true");
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("DeleteAAIVfModuleRequest", request);
String processId = invokeSubProcess("DeleteAAIVfModule", variables);
WorkflowException exception = BPMNUtil.getRawVariable(processEngine, "DeleteAAIVfModule", "WorkflowException", processId);
Assert.assertEquals(1002, exception.getErrorCode());
Assert.assertEquals(true, exception.getErrorMessage().contains("is Base Module, not Last Module"));
logger.debug(exception.getErrorMessage());
}
Aggregations