Search in sources :

Example 21 with ExecuteBuildingBlock

use of org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock in project so by onap.

the class BBInputSetupTest method testgetGBBMacroNoUserParamsOtherException.

@Test(expected = IllegalArgumentException.class)
public void testgetGBBMacroNoUserParamsOtherException() throws Exception {
    GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"), GeneralBuildingBlock.class);
    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);
    requestDetails.getRequestParameters().setUserParams(null);
    org.onap.aai.domain.yang.GenericVnf aaiVnf = new org.onap.aai.domain.yang.GenericVnf();
    aaiVnf.setModelCustomizationId("modelCustId");
    Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
    lookupKeyMap.put(ResourceKey.NETWORK_ID, "networkId");
    lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, "vnfId");
    lookupKeyMap.put(ResourceKey.VF_MODULE_ID, "vfModuleId");
    lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, "volumeGroupId");
    lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "serviceInstanceId");
    String resourceId = "123";
    String vnfType = "vnfType";
    Service service = Mockito.mock(Service.class);
    String requestAction = "assignInstance";
    doReturn(gBB).when(SPY_bbInputSetup).getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap, requestAction, lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
    doReturn(service).when(SPY_bbInputSetupUtils).getCatalogServiceByModelUUID(gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid());
    String generatedId = "12131";
    SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
}
Also used : GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) HashMap(java.util.HashMap) Service(org.onap.so.db.catalog.beans.Service) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) ResourceKey(org.onap.so.bpmn.servicedecomposition.entities.ResourceKey) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) File(java.io.File) Test(org.junit.Test)

Example 22 with ExecuteBuildingBlock

use of org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock in project so by onap.

the class AbstractVnfCDSRequestProviderTest method setUp.

@Before
public void setUp() {
    buildingBlockExecution = createBuildingBlockExecution();
    buildingBlockExecution.setVariable("lookupKeyMap", new HashMap<>());
    executeBuildingBlock = new ExecuteBuildingBlock();
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) Before(org.junit.Before)

Example 23 with ExecuteBuildingBlock

use of org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock in project so by onap.

the class AbstractVnfCDSRequestProviderTest method setScopeAndAction.

protected 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 24 with ExecuteBuildingBlock

use of org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock in project so by onap.

the class GeneratePayloadForCdsTest method setup.

@Before
public void setup() {
    buildingBlockExecution = createBuildingBlockExecution();
    executeBuildingBlock = new ExecuteBuildingBlock();
}
Also used : ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) Before(org.junit.Before)

Example 25 with ExecuteBuildingBlock

use of org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock 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)

Aggregations

ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)147 Test (org.junit.Test)107 ArrayList (java.util.ArrayList)86 List (java.util.List)65 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)63 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)61 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)49 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)45 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)45 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)41 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)40 NorthBoundRequest (org.onap.so.db.catalog.beans.macro.NorthBoundRequest)40 File (java.io.File)38 ArgumentMatchers.anyList (org.mockito.ArgumentMatchers.anyList)38 RelationshipList (org.onap.aai.domain.yang.RelationshipList)38 OrchestrationFlow (org.onap.so.db.catalog.beans.macro.OrchestrationFlow)37 Service (org.onap.so.db.catalog.beans.Service)35 HashMap (java.util.HashMap)27 VfModule (org.onap.aai.domain.yang.VfModule)25 RelatedInstanceList (org.onap.so.serviceinstancebeans.RelatedInstanceList)24