Search in sources :

Example 11 with BuildingBlock

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));
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) Test(org.junit.Test)

Example 12 with BuildingBlock

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);
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock) HashMap(java.util.HashMap) File(java.io.File) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) ResourceKey(org.onap.so.bpmn.servicedecomposition.entities.ResourceKey) Test(org.junit.Test)

Example 13 with BuildingBlock

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);
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)

Example 14 with BuildingBlock

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);
}
Also used : BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) Test(org.junit.Test)

Example 15 with BuildingBlock

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);
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) ExecutionImpl(org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl) Before(org.junit.Before)

Aggregations

BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)66 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)64 Test (org.junit.Test)51 ArrayList (java.util.ArrayList)30 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)30 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)28 File (java.io.File)24 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)22 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)22 ConfigurationResourceKeys (org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys)19 List (java.util.List)18 Service (org.onap.so.db.catalog.beans.Service)18 BaseBBInputSetupTestHelper.prepareConfigurationResourceKeys (org.onap.so.bpmn.servicedecomposition.tasks.BaseBBInputSetupTestHelper.prepareConfigurationResourceKeys)15 RelatedInstanceList (org.onap.so.serviceinstancebeans.RelatedInstanceList)15 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)12 GenericVnf (org.onap.aai.domain.yang.GenericVnf)11 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)11 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)11 DelegateExecution (org.camunda.bpm.engine.delegate.DelegateExecution)10 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)10