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);
}
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();
}
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);
}
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();
}
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));
}
Aggregations