use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation in project so by onap.
the class SDNCChangeAssignTasksTest method changeAssignModelVfModuleTest.
@Test
public void changeAssignModelVfModuleTest() throws Exception {
doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).changeAssignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeAssignModelVfModule(execution);
verify(sdncVfModuleResources, times(1)).changeAssignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VFMODULE, sdncRequest.getTopology());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation in project so by onap.
the class SDNCDeactivateTaskTest method deactivateVfModuleTest.
@Test
public void deactivateVfModuleTest() throws Exception {
doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).deactivateVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncDeactivateTasks.deactivateVfModule(execution);
verify(sdncVfModuleResources, times(1)).deactivateVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VFMODULE, sdncRequest.getTopology());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation in project so by onap.
the class SDNCUnassignTasksTest method unassignVfModuleTest.
@Test
public void unassignVfModuleTest() throws Exception {
doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).unassignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVfModule(execution);
verify(sdncVfModuleResources, times(1)).unassignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VFMODULE, sdncRequest.getTopology());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation in project so by onap.
the class SDNCVfModuleResourcesTest method before.
@Before
public void before() {
vfModule = buildVfModule();
vnf = buildGenericVnf();
serviceInstance = buildServiceInstance();
volumeGroup = buildVolumeGroup();
customer = buildCustomer();
cloudRegion = buildCloudRegion();
requestContext = buildRequestContext();
sdncReq = new GenericResourceApiVfModuleOperationInformation();
try {
testURI = new URI("http://localhost:9800");
} catch (URISyntaxException e) {
}
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation in project so by onap.
the class SDNCAssignTasks method assignVfModule.
/**
* BPMN access method to assigning the vfModule in SDNC.
*
* It will assign the VfModule by the service instance id ,Vnf id and module id.
*
* @param execution
*/
public void assignVfModule(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
RequestContext requestContext = gBBInput.getRequestContext();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
VolumeGroup volumeGroup = null;
try {
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
} catch (BBObjectNotFoundException e) {
logger.info("No volume group was found.");
}
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.assignVfModule(vfModule, volumeGroup, vnf, serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
Aggregations