diff options
author | Rob Daugherty <rd472p@att.com> | 2018-12-10 13:58:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-12-10 13:58:16 +0000 |
commit | fc360bb4bf78fe5d7c14fe98c0bbbefff87dae66 (patch) | |
tree | adabda9c988366142ae7dc49a4d5fe3d37a06ea6 /bpmn/mso-infrastructure-bpmn | |
parent | 3ec3521f0a11b7f83c81b58bd3cd2a42e7f83a37 (diff) | |
parent | c45553d2e9bd80b842b46656fff86e357f959bf1 (diff) |
Merge "fixed headers for traceability"
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn')
-rw-r--r-- | bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java index 335f3468a7..4e45aafc9e 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java @@ -56,6 +56,7 @@ import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.history.HistoricProcessInstance; import org.camunda.bpm.engine.history.HistoricVariableInstance; import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.runtime.ProcessInstanceQuery; import org.camunda.bpm.engine.test.ProcessEngineRule; import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.custommonkey.xmlunit.DetailedDiff; @@ -884,11 +885,20 @@ public abstract class WorkflowTest { return null; } + ProcessInstanceQuery processInstanceQuery = null; if (processInstance == null) { - processInstance = runtimeService + processInstanceQuery = runtimeService .createProcessInstanceQuery() - .processDefinitionKey(processKey) - .singleResult(); + .processDefinitionKey(processKey); + } + + if(processInstanceQuery.count() <= 1){ + processInstance = processInstanceQuery.singleResult(); + }else{ + //TODO There shouldnt be more than one in the list but seems to be happening, need to figure out why happening and best way to get correct one from list + msoLogger.debug("Process Instance Query returned " + processInstanceQuery.count() + " instance. Getting the last instance in the list"); + List<ProcessInstance> processList = processInstanceQuery.list(); + processInstance = processList.get((processList.size() - 1)); } if (processInstance != null) { @@ -927,7 +937,7 @@ public abstract class WorkflowTest { protected boolean injectSDNCRestCallback(String contentType, String content, long timeout) { String sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV1", "SDNCAResponse_CORRELATOR", timeout); - + if (sdncRequestId == null) { sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV2", "SDNCAResponse_CORRELATOR", timeout); @@ -1693,7 +1703,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. - * + * * @param processInstanceId the process Instance Id * @return true if the process is ended */ @@ -1705,7 +1715,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. - * + * * @author cb645j */ //TODO combine into 1 |