use of org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock in project so by onap.
the class BBInputSetupTest method testGetExecuteBBFromExecution.
@Test
public void testGetExecuteBBFromExecution() throws IOException {
BuildingBlock bb = new BuildingBlock().setBpmnFlowName("AssignServiceInstanceBB");
ExecuteBuildingBlock expected = new ExecuteBuildingBlock().setBuildingBlock(bb).setRequestId("00032ab7-3fb3-42e5-965d-8ea592502017");
DelegateExecution execution = Mockito.mock(DelegateExecution.class);
doReturn(expected).when(execution).getVariable(any(String.class));
ExecuteBuildingBlock actual = SPY_bbInputSetup.getExecuteBBFromExecution(execution);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock in project so by onap.
the class BBInputSetupTest method testgetGBBMacroException.
@Test(expected = Exception.class)
public void testgetGBBMacroException() throws Exception {
ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"), ExecuteBuildingBlock.class);
RequestDetails requestDetails = mapper.readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class);
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
String resourceId = "123";
String vnfType = "vnfType";
String requestAction = "createInstance";
BuildingBlock buildingBlock = executeBB.getBuildingBlock();
buildingBlock.setBpmnFlowName("Network").setKey("ab153b6e-c364-44c0-bef6-1f2982117f04");
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
}
use of org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock in project so by onap.
the class GenericCDSProcessingBBTest method setScopeAndAction.
private void setScopeAndAction(String scope, String action) {
BuildingBlock buildingBlock = new BuildingBlock();
buildingBlock.setBpmnScope(scope);
buildingBlock.setBpmnAction(action);
executeBuildingBlock.setBuildingBlock(buildingBlock);
buildingBlockExecution.setVariable(BUILDING_BLOCK, executeBuildingBlock);
}
use of org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock in project so by onap.
the class ExecuteActivityTest method executeBuildingBlock_Test.
@Test
public void executeBuildingBlock_Test() throws Exception {
BuildingBlock bb = executeActivity.buildBuildingBlock("testActivityName");
ExecuteBuildingBlock ebb = executeActivity.buildExecuteBuildingBlock(execution, "testMsoRequestId", bb);
assertEquals(ebb.getVnfType(), "testVnfType");
assertEquals(ebb.getRequestAction(), "testRequestAction");
assertEquals(ebb.getRequestId(), "testMsoRequestId");
assertEquals(ebb.getWorkflowResourceIds().getVnfId(), "testVnfId");
assertEquals(ebb.getWorkflowResourceIds().getServiceInstanceId(), "testServiceInstanceId");
assertEquals(ebb.getBuildingBlock(), bb);
}
use of org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock in project so by onap.
the class GenericPnfCDSControllerRunnableBBTest method setUp.
@Before
public void setUp() {
ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
BuildingBlock buildingBlock = new BuildingBlock();
buildingBlock.setBpmnAction(action);
executeBuildingBlock.setBuildingBlock(buildingBlock);
execution = new DelegateExecutionImpl(new ExecutionImpl());
execution.setVariable("buildingBlock", executeBuildingBlock);
execution.setVariable(PRC_BLUEPRINT_NAME, blueprintName);
execution.setVariable(PRC_BLUEPRINT_VERSION, blueprintVersion);
execution.setVariable(MSO_REQUEST_ID, msoRequestId);
execution.setVariable(SCOPE, "scope");
controllerContext = new ControllerContext<>();
controllerContext.setExecution(execution);
}
Aggregations