From 015b92c3d96fb42f80b018fdf8f639f1cf3298c3 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 11 Oct 2017 11:49:51 -0400 Subject: Add junit test coverage and fix bugs in VCPE Added additional junit tests for VCPE and fixed bugs that were found while testing. Change-Id: Icb6a0c936a16b775ff553c11cb07a4348bd9ebfc Issue-ID: SO-210 Signed-off-by: Jim Hahn --- .../test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp') diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java index 9057904da3..f60d984a6d 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java @@ -21,6 +21,9 @@ package org.openecomp.mso.bpmn.common; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doAnswer; @@ -77,7 +80,18 @@ public class BPMNUtil { .getValue(); return (T) responseData; } + + + public static void assertAnyProcessInstanceFinished(ProcessEngineServices processEngineServices, String processDefinitionID) { + String pID = getProcessInstanceId(processEngineServices, + processDefinitionID); + assertNotNull(pID); + assertTrue(processEngineServices.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(pID).finished().count() > 0); + } + public static void assertNoProcessInstance(ProcessEngineServices processEngineServices, String processDefinitionID) { + assertNull(getProcessInstanceId(processEngineServices, processDefinitionID)); + } public static void assertProcessInstanceFinished(ProcessEngineServices processEngineServices, String pid) { assertEquals(1, processEngineServices.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(pid).finished().count()); -- cgit 1.2.3-korg