use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.
the class MultiStageSkipListenerTest method testProcessMultiStageSkip.
@Test
public void testProcessMultiStageSkip() {
String vfModuleId = "vfModuleId";
String vnfId = "vnfId";
List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("serviceInstanceId");
workflowResourceIds.setVnfId(vnfId);
BuildingBlock bb = new BuildingBlock().setBpmnFlowName("AssignVfModuleBB");
ExecuteBuildingBlock ebb = new ExecuteBuildingBlock().setResourceId(vfModuleId).setBuildingBlock(bb).setWorkflowResourceIds(workflowResourceIds);
flowsToExecute.add(ebb);
flowsToExecute.add(new ExecuteBuildingBlock());
flowsToExecute.add(new ExecuteBuildingBlock());
BuildingBlockExecution execution = new DelegateExecutionImpl(new DelegateExecutionFake());
org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule();
vfModule.setVfModuleId(vfModuleId);
org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf();
vnf.setModelCustomizationId("modelCustomizationUUID");
VnfResourceCustomization vnfCust = new VnfResourceCustomization();
vnfCust.setModelCustomizationUUID("modelCustomizationUUID");
vnfCust.setMultiStageDesign("true");
when(catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(vnf.getModelCustomizationId())).thenReturn(vnfCust);
when(bbInputSetupUtils.getAAIVfModule(eq(vnfId), eq(vfModuleId))).thenReturn(null);
when(bbInputSetupUtils.getAAIGenericVnf(eq(vnfId))).thenReturn(vnf);
multiStageSkipListener.run(flowsToExecute, flowsToExecute.get(0), execution);
assertEquals("Flows should only have Assign", flowsToExecute.size(), 1);
assertEquals("Flows should only have Assign", flowsToExecute.get(0).getBuildingBlock().getBpmnFlowName(), "AssignVfModuleBB");
}
use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.
the class MultiStageSkipListenerTest method postCompletionRequestsDbListenerTest.
@Test
public void postCompletionRequestsDbListenerTest() {
InfraActiveRequests request = new InfraActiveRequests();
BuildingBlockExecution execution = new DelegateExecutionImpl(new DelegateExecutionFake());
multiStageSkipListener.run(request, execution);
assertEquals("Successfully completed Assign Building Block only due to multi-stage-design VNF", request.getFlowStatus());
}
use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.
the class WorkflowActionBBTasksUpdateReqDbTest method before.
@Before
public void before() throws Exception {
execution = new DelegateExecutionFake();
org.onap.aai.domain.yang.ServiceInstance servInstance = new org.onap.aai.domain.yang.ServiceInstance();
servInstance.setServiceInstanceId("TEST");
when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), any())).thenReturn(servInstance);
workflowAction.setBbInputSetupUtils(bbSetupUtils);
workflowAction.setBbInputSetup(bbInputSetup);
}
use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.
the class WorkflowActionBBTasksTest method before.
@Before
public void before() throws Exception {
execution = new DelegateExecutionFake();
ServiceInstance servInstance = new ServiceInstance();
servInstance.setServiceInstanceId("TEST");
when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), anyObject())).thenReturn(servInstance);
workflowAction.setBbInputSetupUtils(bbSetupUtils);
workflowAction.setBbInputSetup(bbInputSetup);
}
use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.
the class PnfCDSRequestProviderTest method prepareDelegateExecutionObj.
private DelegateExecution prepareDelegateExecutionObj(String scope, String action) {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable(PROCESS_KEY, TEST_PROCESS_KEY);
execution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
execution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
execution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
execution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
execution.setVariable(PNF_UUID, TEST_PNF_UUID);
execution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
execution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
execution.setVariable(PRC_TARGET_SOFTWARE_VERSION, TEST_SOFTWARE_VERSION);
execution.setVariable(SCOPE, scope);
execution.setVariable(ACTION, action);
execution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
execution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
return execution;
}
Aggregations