use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation in project so by onap.
the class SDNCDeactivateTasks method deactivateNetwork.
/**
* BPMN access method to invoke deactivate on a L3Network object
*
* @param execution
*/
public void deactivateNetwork(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
Customer customer = gBBInput.getCustomer();
RequestContext requestContext = gBBInput.getRequestContext();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
GenericResourceApiNetworkOperationInformation req = sdncNetworkResources.deactivateNetwork(l3Network, serviceInstance, customer, requestContext, cloudRegion);
SDNCRequest sdncRequest = new SDNCRequest();
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.NETWORK);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
logger.error("Exception occurred in SDNCDeactivateTasks deactivateNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation in project so by onap.
the class SDNCNetworkResourcesTest method unassignNetwork_Test.
@Test
public void unassignNetwork_Test() throws Exception {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper).reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance, customer, requestContext, cloudRegion);
sdncNetworkResources.unassignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
verify(MOCK_networkTopologyOperationRequestMapper, times(1)).reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance, customer, requestContext, cloudRegion);
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation in project so by onap.
the class SDNCNetworkResourcesTest method changeAssignNetworkTest.
@Test
public void changeAssignNetworkTest() throws MapperException, BadResponseException {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper).reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer, requestContext, cloudRegion);
sdncNetworkResources.changeAssignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
verify(MOCK_networkTopologyOperationRequestMapper, times(1)).reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer, requestContext, cloudRegion);
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation in project so by onap.
the class SDNCUnassignTasksTest method unassignNetworkTest.
@Test
public void unassignNetworkTest() throws Exception {
String cloudRegionSdnc = "AAIAIC25";
cloudRegion.setCloudRegionVersion("2.5");
execution.setVariable("cloudRegionSdnc", cloudRegionSdnc);
doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources).unassignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
assertNotEquals(cloudRegionSdnc, cloudRegion.getLcpCloudRegionId());
sdncUnassignTasks.unassignNetwork(execution);
verify(sdncNetworkResources, times(1)).unassignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
assertEquals(cloudRegionSdnc, cloudRegion.getLcpCloudRegionId());
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.NETWORK, sdncRequest.getTopology());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation in project so by onap.
the class SDNCAssignTasksTest method assignNetworkTest.
@Test
public void assignNetworkTest() throws Exception {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources).assignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
sdncAssignTasks.assignNetwork(execution);
verify(sdncNetworkResources, times(1)).assignNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.NETWORK, sdncRequest.getTopology());
}
Aggregations