summaryrefslogtreecommitdiffstats
path: root/bpmn/mso-infrastructure-bpmn/src/test/java/org
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-22 12:10:23 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-22 12:10:59 -0400
commitce28fc9159d0d554ef06fdd1f6e1f4c0918ad269 (patch)
tree807d79ffc32d9bc590e0c85d78d3acadad1cfbeb /bpmn/mso-infrastructure-bpmn/src/test/java/org
parent66c2def4d7b1a85cccea76f9d5096bf3e23f3b9b (diff)
Prod fixes August 18th
fixed compilation issues and all unit tests now pass fix condition that checks for vnf in list to set homing flags fix resource name variable being null Skip volume group search for alacarte VF Module creation, since that group is expected to be specified on the input Remove temporary change to JUnit for creation of volume group. Add mapping of isBaseVfModule setting to AAIObjectMapper for vfModule. adding a unit test for hte issue which was fixed Explicitly return heatStackId variable from VnfAdapter subprocess Fixing an issue with the workflow processor/asynresource which may lead to apihandler leaving the active_Request table record in_progress while the bpmn quits the processing due to the error. Change-Id: I7587193fcb5251f50370d72a1e4c10d112a1c72f Issue-ID: SO-879 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test/java/org')
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceExceptionHandlingTest.java78
1 files changed, 78 insertions, 0 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceExceptionHandlingTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceExceptionHandlingTest.java
new file mode 100644
index 0000000000..ff5e18c210
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceExceptionHandlingTest.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.common.workflow.service;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.ws.rs.core.Response;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
+import org.junit.Test;
+import org.onap.so.bpmn.common.workflow.context.WorkflowResponse;
+
+
+public class WorkflowAsyncResourceExceptionHandlingTest {
+
+ @Test
+ @Deployment(resources = { "testAsyncResource.bpmn" })
+ public void asyncRequestSuccess() throws InterruptedException {
+ VariableMapImpl variableMap = new VariableMapImpl();
+
+ Map<String, Object> variableValueType = new HashMap<>();
+
+ Map<String, Object> requestMsg = new HashMap<>();
+ requestMsg.put("value", "");
+ requestMsg.put("type", "String");
+
+ Map<String, Object> msorequestId = new HashMap<>();
+ msorequestId.put("type", "String");
+ msorequestId.put("value",UUID.randomUUID().toString());
+
+ Map<String, Object> timeout = new HashMap<>();
+ timeout.put("type", "String");
+ timeout.put("value","5");
+
+ variableValueType.put("testAsyncRequestMsg", requestMsg);
+ variableValueType.put("mso-request-id", msorequestId);
+ variableValueType.put("mso-service-request-timeout", timeout);
+
+ variableMap.put("variables", variableValueType);
+ WorkflowAsyncResource workflowAsyncResource = new WorkflowAsyncResource();
+ workflowAsyncResource.setProcessor(new WorkflowProcessor());
+ Response res = workflowAsyncResource.startProcessInstanceByKey("randomKey", variableMap);
+ assertEquals(500,res.getStatus());
+ WorkflowResponse workflowResponse = (WorkflowResponse)res.getEntity();
+ assertNotNull(workflowResponse);
+ assertEquals(500, workflowResponse.getMessageCode());
+ assertTrue(workflowResponse.getResponse().startsWith("Error occurred while executing the process:"));
+ assertEquals("Fail", workflowResponse.getMessage());
+
+
+ }
+
+}