From 833d219c3b6689ea27f46719a3a00cbaf7e649fe Mon Sep 17 00:00:00 2001 From: "Kuleshov, Elena" Date: Fri, 10 Jan 2020 09:53:29 -0500 Subject: 1911 create appc adapter micro service Added new appc adapter micro service. Made required code changes to use the new adapter. Issue-ID: SO-2596 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I880ecace64ec85ca4094a82bc1210798fd3bb85d --- .../Activity/DistributeTrafficActivity.bpmn | 4 +- .../Activity/DistributeTrafficCheckActivity.bpmn | 4 +- .../VNFCheckClosedLoopDisabledFlagActivity.bpmn | 6 +- .../Activity/VNFCheckInMaintFlagActivity.bpmn | 4 +- .../VNFCheckPserversLockedFlagActivity.bpmn | 4 +- .../Activity/VNFHealthCheckActivity.bpmn | 4 +- .../subprocess/Activity/VNFLockActivity.bpmn | 6 +- .../Activity/VNFQuiesceTrafficActivity.bpmn | 6 +- .../Activity/VNFResumeTrafficActivity.bpmn | 6 +- .../VNFSetClosedLoopDisabledFlagActivity.bpmn | 4 +- .../Activity/VNFSetInMaintFlagActivity.bpmn | 4 +- .../subprocess/Activity/VNFSnapShotActivity.bpmn | 109 ++++++++++++++++++--- .../subprocess/Activity/VNFStartActivity.bpmn | 6 +- .../subprocess/Activity/VNFStopActivity.bpmn | 6 +- .../subprocess/Activity/VNFUnlockActivity.bpmn | 6 +- .../VNFUnsetClosedLoopDisabledFlagActivity.bpmn | 2 +- .../Activity/VNFUnsetInMaintFlagActivity.bpmn | 4 +- .../Activity/VNFUpgradeBackupActivity.bpmn | 6 +- .../Activity/VNFUpgradePostCheckActivity.bpmn | 6 +- .../Activity/VNFUpgradePreCheckActivity.bpmn | 6 +- .../Activity/VNFUpgradeSoftwareActivity.bpmn | 6 +- .../test/java/org/onap/so/bpmn/BaseBPMNTest.java | 20 ++++ .../subprocess/DistributeTrafficActivityTest.java | 15 +-- .../DistributeTrafficCheckActivityTest.java | 18 ++-- .../subprocess/PauseForManualTaskActivityTest.java | 1 - .../subprocess/VNFHealthCheckActivityTest.java | 15 +-- .../bpmn/subprocess/VNFLockActivityTest.java | 16 +-- .../subprocess/VNFQuiesceTrafficActivityTest.java | 15 +-- .../subprocess/VNFResumeTrafficActivityTest.java | 15 +-- .../VNFSetClosedLoopDisabledFlagActivityTest.java | 1 - .../bpmn/subprocess/VNFSnapShotActivityTest.java | 18 ++-- .../bpmn/subprocess/VNFStartActivityTest.java | 16 +-- .../bpmn/subprocess/VNFStopActivityTest.java | 16 +-- .../bpmn/subprocess/VNFUnlockActivityTest.java | 16 +-- .../subprocess/VNFUpgradeBackupActivityTest.java | 14 +-- .../VNFUpgradePostCheckActivityTest.java | 16 +-- .../subprocess/VNFUpgradePreCheckActivityTest.java | 15 +-- .../subprocess/VNFUpgradeSoftwareActivityTest.java | 15 +-- 38 files changed, 277 insertions(+), 174 deletions(-) (limited to 'bpmn/so-bpmn-building-blocks') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn index 4ea6bb10b1..496fcb1784 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn index 19a4972187..a5bde79237 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn index 9ac0f38835..50fc40f450 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn @@ -1,6 +1,6 @@ - - + + SequenceFlow_01c8z5u @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn index 8709f399a5..ed6b10feed 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0h1gkvd @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn index 9c327a4da9..49777daa02 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0a56huh @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn index 2e97206867..2e66f6c948 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn index 1aaa920ef8..43f2f4d6d3 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn index ac09674884..d0073803e9 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn index c21072a32a..888ce18467 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn index f356634106..c02161eb61 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0pp6ze7 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn index 2bdb1d7533..a0d0cbd5d7 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0zaz9o2 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn index 8115f694c2..f7bf835bd9 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn @@ -5,19 +5,44 @@ SequenceFlow_06vhbci - SequenceFlow_01312aj + SequenceFlow_048qlth + SequenceFlow_17zvrl5 - - - SequenceFlow_0cf0riu + + + SequenceFlow_041lqrr SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu - + + + + SequenceFlow_0cf0riu + SequenceFlow_0aachpx + SequenceFlow_048qlth + + + 0}]]> + + + + SequenceFlow_0aachpx + SequenceFlow_12eenwu + SequenceFlow_041lqrr + + + SequenceFlow_01312aj + SequenceFlow_17zvrl5 + SequenceFlow_12eenwu + + + + + @@ -25,9 +50,9 @@ - + - + @@ -38,25 +63,79 @@ - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn index f0490a9b61..da1e4a3630 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn index 0e02295631..93d442eaa5 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn index 6d1b68cb7b..ef4162c60e 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn index d70e103009..575e3124fa 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn @@ -44,4 +44,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn index 05d3fcfa27..59eb80c16e 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0zaz9o2 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn index dfcf9974ee..1b37867ecf 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn index 56c24dabc9..b9c4d89be9 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn index 1ec0a18dd5..33886e358d 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn index 89481a5640..16df667f6a 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn @@ -9,12 +9,12 @@ - + SequenceFlow_0cf0riu SequenceFlow_01312aj - + SequenceFlow_06vhbci SequenceFlow_0cf0riu @@ -59,4 +59,4 @@ - + \ No newline at end of file diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java index ff987b75d4..5b7fe66f54 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java @@ -19,6 +19,7 @@ */ package org.onap.so.bpmn; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -26,6 +27,8 @@ import java.util.Map; import org.camunda.bpm.engine.ExternalTaskService; import org.camunda.bpm.engine.RepositoryService; import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.extension.mockito.mock.FluentJavaDelegateMock; import org.camunda.bpm.model.bpmn.Bpmn; import org.camunda.bpm.model.bpmn.BpmnModelInstance; @@ -49,6 +52,7 @@ import org.onap.so.bpmn.infrastructure.adapter.network.tasks.NetworkAdapterUpdat import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterCreateTasks; import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterDeleteTasks; import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterImpl; +import org.onap.so.bpmn.infrastructure.appc.tasks.AppcOrchestratorPreProcessor; import org.onap.so.bpmn.infrastructure.appc.tasks.AppcRunTasks; import org.onap.so.bpmn.infrastructure.audit.AuditTasks; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.ActivateVfModule; @@ -130,6 +134,9 @@ public abstract class BaseBPMNTest { @MockBean protected AppcRunTasks appcRunTasks; + @MockBean + protected AppcOrchestratorPreProcessor appcOrchestratorPreProcessor; + @MockBean protected SDNCActivateTasks sdncActivateTasks; @@ -299,4 +306,17 @@ public abstract class BaseBPMNTest { mockedSubprocessList.add(repositoryService.createDeployment() .addModelInstance(fileName + ".bpmn", modelInstance).deploy().getId()); } + + protected void processExternalTasks(ProcessInstance pi, String taskName) { + assertThat(pi).isWaitingAt(taskName); + List tasks = + externalTaskService.fetchAndLock(100, "externalWorkerId").topic("AppcService", 60L * 1000L).execute(); + while (!tasks.isEmpty()) { + for (LockedExternalTask task : tasks) { + externalTaskService.complete(task.getId(), "externalWorkerId"); + } + tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("AppcService", 60L * 1000L) + .execute(); + } + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java index 8306de4794..dae430e400 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class DistributeTrafficActivityTest extends BaseBPMNTest { @Test public void sunnyDayDistributeTrafficActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskDistributeTraffic"); assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity", "TaskDistributeTraffic", "DistributeTrafficActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class DistributeTrafficActivityTest extends BaseBPMNTest { @Test public void rainyDayDistributeTrafficActivity_Test() throws Exception { - variables.put("actionDistributeTraffic", Action.DistributeTraffic); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity", "TaskDistributeTraffic") - .hasNotPassed("DistributeTrafficActivity_End"); + .hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskDistributeTraffic", "DistributeTrafficActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java index 195a1ed809..7c18a20604 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class DistributeTrafficCheckActivityTest extends BaseBPMNTest { @Test public void sunnyDayDistributeTrafficCheckActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskDistributeTrafficCheck"); assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start", "TaskPreProcessActivity", "TaskDistributeTrafficCheck", "DistributeTrafficCheckActivity_End"); assertThat(pi).isEnded(); @@ -42,14 +44,12 @@ public class DistributeTrafficCheckActivityTest extends BaseBPMNTest { @Test public void rainyDayDistributeTrafficActivity_Test() throws Exception { - variables.put("actionDistributeTrafficCheck", Action.DistributeTrafficCheck); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables); - assertThat(pi) - .isNotNull().isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start", - "TaskPreProcessActivity", "TaskDistributeTrafficCheck") - .hasNotPassed("DistributeTrafficCheckActivity_End"); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("DistributeTrafficCheckActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskDistributeTrafficCheck", "DistributeTrafficCheckActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java index c0b0094f20..48104017a5 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java @@ -29,7 +29,6 @@ import org.camunda.bpm.engine.TaskService; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.Job; import org.camunda.bpm.engine.runtime.ProcessInstance; -import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.task.Task; import org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions; import org.junit.Test; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java index 0b17e3e099..10040b813c 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFHealthCheckActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskHealthCheck"); assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity", "TaskHealthCheck", "VNFHealthCheckActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class VNFHealthCheckActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFHealthCheckActivity_Test() throws Exception { - variables.put("actionHealthCheck", Action.HealthCheck); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity", "TaskHealthCheck") - .hasNotPassed("VNFHealthCheckActivity_End"); + .hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskHealthCheck", "VNFHealthCheckActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java index 45cf44848f..a174bbb90c 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFLockActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFLockActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskLock"); assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock", "VNFLockActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,11 @@ public class VNFLockActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFLockActivity_Test() throws Exception { - variables.put("actionLock", Action.Lock); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock") - .hasNotPassed("VNFLockActivity_End"); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskLock", "VNFLockActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java index fb462bc02f..b1229cdfdf 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskQuiesceTraffic"); assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity", "TaskQuiesceTraffic", "VNFQuiesceTrafficActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception { - variables.put("actionQuiesceTraffic", Action.QuiesceTraffic); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity", "TaskQuiesceTraffic") - .hasNotPassed("VNFQuiesceTrafficActivity_End"); + .hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskQuiesceTraffic", "VNFQuiesceTrafficActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java index 61d88a5770..ae61f3c46e 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFResumeTrafficActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskResumeTraffic"); assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity", "TaskResumeTraffic", "VNFResumeTrafficActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class VNFResumeTrafficActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFResumeTrafficActivity_Test() throws Exception { - variables.put("actionResumeTraffic", Action.ResumeTraffic); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity", "TaskResumeTraffic") - .hasNotPassed("VNFResumeTrafficActivity_End"); + .hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskResumeTraffic", "VNFResumeTrafficActivity_End"); } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java index 001dc70b54..513afd35e5 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; -import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java index 6f1e076c02..b883f1cb28 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java @@ -28,27 +28,27 @@ import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFSnapShotActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException { + variables.put("vmIdListSize", 0); + variables.put("vmIdList", null); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", - "TaskSnapShot", "VNFSnapShotActivity_End"); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", "VNFSnapShotActivity_End") + .hasNotPassed("TaskSnapShot"); assertThat(pi).isEnded(); } @Test public void rainyDayVNFSnapShotActivity_Test() throws Exception { - variables.put("actionSnapshot", Action.Snapshot); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", "TaskSnapShot") - .hasNotPassed("VNFSnapShotActivity_End"); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskSnapShot", "VNFSnapShotActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java index 2163e0b7a8..0a700c5fa1 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFStartActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFStartActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskStart"); assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart", "VNFStartActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,11 @@ public class VNFStartActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFStartActivity_Test() throws Exception { - variables.put("actionStart", Action.Start); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart") - .hasNotPassed("VNFStartActivity_End"); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskStart", "VNFStartActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java index 58dfff8bd7..89cc13f0f0 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFStopActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFStopActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskStop"); assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop", "VNFStopActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,11 @@ public class VNFStopActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFStopActivity_Test() throws Exception { - variables.put("actionStop", Action.Stop); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop") - .hasNotPassed("VNFStopActivity_End"); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskStop", "VNFStopActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java index c5ddd56880..0dbde4b62c 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFUnlockActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskUnlock"); assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock", "VNFUnlockActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,11 @@ public class VNFUnlockActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFUnlockActivity_Test() throws Exception { - variables.put("actionUnlock", Action.Unlock); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock") - .hasNotPassed("VNFUnlockActivity_End"); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskUnlock", "VNFUnlockActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java index 4d99147761..2d4a11c17e 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java @@ -23,18 +23,20 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFUpgradeBackupActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskUpgradeBackup"); assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity", "TaskUpgradeBackup", "VNFUpgradeBackupActivity_End"); assertThat(pi).isEnded(); @@ -42,14 +44,12 @@ public class VNFUpgradeBackupActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception { - variables.put("actionUpgradeBackup", Action.UpgradeBackup); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity", "TaskUpgradeBackup") - .hasNotPassed("VNFUpgradeBackupActivity_End"); + assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskUpgradeBackup", "VNFUpgradeBackupActivity_End"); assertThat(pi).isEnded(); } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java index c87cc44f29..dfb6bc1d9c 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java @@ -20,20 +20,22 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); + processExternalTasks(pi, "TaskUpgradePostCheck"); assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePostCheck", "VNFUpgradePostCheckActivity_End"); @@ -41,14 +43,12 @@ public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception { - variables.put("actionUpgradePostCheck", Action.UpgradePostCheck); - - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePostCheck") - .hasNotPassed("VNFUpgradePostCheckActivity_End"); + .hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskUpgradePostCheck", "VNFUpgradePostCheckActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java index 79fc43396d..9854bd8860 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskUpgradePreCheck"); assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePreCheck", "VNFUpgradePreCheckActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception { - variables.put("actionUpgradePreCheck", Action.UpgradePreCheck); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePreCheck") - .hasNotPassed("VNFUpgradePreCheckActivity_End"); + .hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskUpgradePreCheck", "VNFUpgradePreCheckActivity_End"); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java index b550185702..de999e1074 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java @@ -20,21 +20,23 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; +import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -import org.onap.appc.client.lcm.model.Action; public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest { @Test public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); assertThat(pi).isNotNull(); + processExternalTasks(pi, "TaskUpgradeSoftware"); assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity", "TaskUpgradeSoftware", "VNFUpgradeSoftwareActivity_End"); assertThat(pi).isEnded(); @@ -42,13 +44,12 @@ public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest { @Test public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception { - variables.put("actionUpgradeSoftware", Action.UpgradeSoftware); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity", "TaskUpgradeSoftware") - .hasNotPassed("VNFUpgradeSoftwareActivity_End"); + .hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity") + .hasNotPassed("TaskUpgradeSoftware", "VNFUpgradeSoftwareActivity_End"); } } -- cgit 1.2.3-korg