diff options
author | SunilB <sb00577584@techmahindra.com> | 2019-04-15 19:52:11 +0530 |
---|---|---|
committer | SunilB <sb00577584@techmahindra.com> | 2019-04-15 19:52:11 +0530 |
commit | c5d5e14f506a9be6e93003b88f0aed42e5030ebf (patch) | |
tree | 60d31ce74dd80deb4df0e82b4fb81a1eadfb1796 /bpmn/so-bpmn-tasks/src/test/java/org/onap | |
parent | 9c0663079469cb5a42c96ff990385c23be2f361e (diff) |
Conditional Macro Action Selection
Update orchestration_flow_reference table and changes in
WorkflowActionBBTasks to Conditionally trigger ConfigAssignVnfBB And
ConfigDeployVnfBB building block.
Change-Id: I1bdb8a77223aef6855e4e1c9aa80dd026892e6f6
Issue-ID: SO-1702
Signed-off-by: sunilb <sb00577584@techmahindra.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java/org/onap')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java | 49 |
1 files changed, 49 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 029562a6e9..a60927d694 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 @@ -40,10 +40,13 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; +import org.onap.aai.domain.yang.GenericVnf; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; +import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; +import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.request.beans.InfraActiveRequests; import org.springframework.core.env.Environment; @@ -90,7 +93,30 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { execution.setVariable("calledHoming", false); List<ExecuteBuildingBlock> flowsToExecute = new ArrayList(); ExecuteBuildingBlock ebb = new ExecuteBuildingBlock(); + + String vnfCustomizationUUID = "1234567"; + String serviceInstanceId = "1234567"; + BuildingBlock buildingBlock = new BuildingBlock(); + buildingBlock.setBpmnFlowName("ConfigAssignVnfBB"); + buildingBlock.setKey(vnfCustomizationUUID); + ebb.setBuildingBlock(buildingBlock); + WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); + workflowResourceIds.setServiceInstanceId(serviceInstanceId); + ebb.setWorkflowResourceIds(workflowResourceIds); flowsToExecute.add(ebb); + + List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList(); + VnfResourceCustomization vrc = new VnfResourceCustomization(); + vrc.setSkipPostInstConf(false); + vrc.setModelCustomizationUUID(vnfCustomizationUUID); + vnfResourceCustomizations.add(vrc); + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setModelCustomizationId(vnfCustomizationUUID); + doReturn(vnfResourceCustomizations).when(catalogDbClient) + .getVnfResourceCustomizationByModelUuid(serviceInstanceId); + doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, + vnfResourceCustomizations); + execution.setVariable("flowsToExecute", flowsToExecute); workflowActionBBTasks.selectBB(execution); boolean success = (boolean) execution.getVariable("completed"); @@ -110,7 +136,30 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { List<ExecuteBuildingBlock> flowsToExecute = new ArrayList(); ExecuteBuildingBlock ebb = new ExecuteBuildingBlock(); ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock(); + + String vnfCustomizationUUID = "1234567"; + String serviceInstanceId = "1234567"; + BuildingBlock buildingBlock = new BuildingBlock(); + buildingBlock.setBpmnFlowName("ConfigDeployVnfBB"); + buildingBlock.setKey(vnfCustomizationUUID); + ebb.setBuildingBlock(buildingBlock); + WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); + workflowResourceIds.setServiceInstanceId(serviceInstanceId); + ebb.setWorkflowResourceIds(workflowResourceIds); flowsToExecute.add(ebb); + + List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList(); + VnfResourceCustomization vrc = new VnfResourceCustomization(); + vrc.setSkipPostInstConf(false); + vrc.setModelCustomizationUUID(vnfCustomizationUUID); + vnfResourceCustomizations.add(vrc); + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setModelCustomizationId(vnfCustomizationUUID); + doReturn(vnfResourceCustomizations).when(catalogDbClient) + .getVnfResourceCustomizationByModelUuid(serviceInstanceId); + doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, + vnfResourceCustomizations); + flowsToExecute.add(ebb2); execution.setVariable("flowsToExecute", flowsToExecute); workflowActionBBTasks.selectBB(execution); |