summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test/java
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2020-10-27 13:17:58 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-27 13:17:58 +0000
commitdeb4f1d1292d661b08f8969a117b7b979551158a (patch)
tree1918d299d6858d67145fcf5b7c1895cd8e3fe740 /bpmn/so-bpmn-tasks/src/test/java
parent0f7afcbce63e8935d5e798f7007e1da8cf8774b7 (diff)
parentaaec67060a5973ccf2ef263cb928e3a7e8d36b6a (diff)
Merge "Revert "PNF service instantiation using building blocks fails""1.7.7
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java42
2 files changed, 5 insertions, 41 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index b0358c51f0..3290bb3dce 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -41,6 +41,7 @@ import org.onap.aai.domain.yang.ServiceInstance;
import org.onap.aai.domain.yang.VfModule;
import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
@@ -89,6 +90,9 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
@Mock
protected Environment environment;
+ @Mock
+ private FlowManipulatorListenerRunner flowManipulatorListenerRunner;
+
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
index 1d68cf0adb..fdf4d36c89 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
@@ -55,10 +55,10 @@ public class SkipCDSBuildingBlockListenerTest {
private static final String PNFModule_TEST_ACTION = "config-assign";
private static final String MODELCUSTOMIZATIONUUID = "123456789";
private static final String BBNAME = "ControllerExecutionBB";
- private static final String COMPLETED = "completed";
private static final boolean ISFIRST = true;
private int actual;
+ private List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
private List<VnfResourceCustomization> vnfResourceCustomization;
private List<VfModuleCustomization> vfModuleCustomization;
private ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
@@ -91,9 +91,6 @@ public class SkipCDSBuildingBlockListenerTest {
@Test
public void testProcessForVNFToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, 0);
vnfResourceCustomization = getVnfResourceCustomizationList(true);
@@ -115,9 +112,6 @@ public class SkipCDSBuildingBlockListenerTest {
@Test
public void testProcessForVNFNotToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, 0);
vnfResourceCustomization = getVnfResourceCustomizationList(false);
@@ -140,9 +134,6 @@ public class SkipCDSBuildingBlockListenerTest {
@Test
public void testProcessForVFToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, 0);
vfModuleCustomization = getVfModuleCustomizationList(true);
@@ -162,9 +153,6 @@ public class SkipCDSBuildingBlockListenerTest {
@Test
public void testProcessForVFNotToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, 0);
vfModuleCustomization = getVfModuleCustomizationList(false);
@@ -184,9 +172,6 @@ public class SkipCDSBuildingBlockListenerTest {
@Test
public void testProcessForPNFToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
pnfResourceCustomization = getPnfResourceCustomization(true);
@@ -205,32 +190,7 @@ public class SkipCDSBuildingBlockListenerTest {
}
@Test
- public void testProcessForPNFToSkipCDSBBLastBBInList() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- // given
- setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
- pnfResourceCustomization = getPnfResourceCustomization(true);
-
- when(catalogDbClient
- .getPnfResourceCustomizationByModelCustomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
- .thenReturn(pnfResourceCustomization);
-
- // when
- skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
-
- // then
- actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
- boolean isCompleted = buildingBlockExecution.getVariable(COMPLETED);
- assertEquals(true, isCompleted);
- assertEquals(0, actual);
- }
-
- @Test
public void testProcessForPNFNotToSkipCDSBB() {
- List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
- flowsToExecute.add(executeBuildingBlock);
- flowsToExecute.add(new ExecuteBuildingBlock());
// given
setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
pnfResourceCustomization = getPnfResourceCustomization(false);