diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java | 34 |
1 files changed, 34 insertions, 0 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 a7ee89f073..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 @@ -436,6 +436,40 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { } @Test + public void rollbackExecutionRollbackToCreatedNoConfigurationWithFabricTest() { + execution.setVariable("isRollback", false); + execution.setVariable("handlingCode", "RollbackToCreatedNoConfiguration"); + execution.setVariable("requestAction", EMPTY_STRING); + execution.setVariable("resourceName", EMPTY_STRING); + List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>(); + + BuildingBlock buildingBlock1 = new BuildingBlock().setBpmnFlowName("AssignVfModuleBB"); + ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock1); + flowsToExecute.add(ebb1); + + BuildingBlock buildingBlock2 = new BuildingBlock().setBpmnFlowName("CreateVfModuleBB"); + ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock2); + flowsToExecute.add(ebb2); + + BuildingBlock buildingBlock3 = new BuildingBlock().setBpmnFlowName("ActivateVfModuleBB"); + ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock3); + flowsToExecute.add(ebb3); + + BuildingBlock buildingBlock4 = new BuildingBlock().setBpmnFlowName("AddFabricConfigurationBB"); + ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock4); + flowsToExecute.add(ebb4); + + execution.setVariable("flowsToExecute", flowsToExecute); + execution.setVariable("gCurrentSequence", 4); + + workflowActionBBTasks.rollbackExecutionPath(execution); + List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); + assertEquals(0, execution.getVariable("gCurrentSequence")); + assertEquals(1, ebbs.size()); + assertEquals("DeactivateVfModuleBB", ebbs.get(0).getBuildingBlock().getBpmnFlowName()); + } + + @Test public void rollbackExecutionRollbackToCreatedTest() { execution.setVariable("isRollback", false); execution.setVariable("handlingCode", "RollbackToCreated"); |