use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.
the class SDNCAssignTasksTest method assignServiceInstanceTest.
@Test
public void assignServiceInstanceTest() throws Exception {
doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources).assignServiceInstance(serviceInstance, customer, requestContext);
sdncAssignTasks.assignServiceInstance(execution);
verify(sdncServiceInstanceResources, times(1)).assignServiceInstance(serviceInstance, customer, requestContext);
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.SERVICE, sdncRequest.getTopology());
}
use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.
the class SDNCRequestTasksTest method createSDNCRequest.
public SDNCRequest createSDNCRequest() {
SDNCRequest request = new SDNCRequest();
request.setCorrelationName("correlationName");
request.setCorrelationValue("correlationValue");
request.setTopology(SDNCTopology.CONFIGURATION);
ObjectMapper mapper = new ObjectMapper();
try {
GenericResourceApiServiceOperationInformation sdncReq = mapper.readValue(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNC_Client_Request.json")), GenericResourceApiServiceOperationInformation.class);
request.setSDNCPayload(sdncReq);
} catch (JsonParseException e) {
} catch (JsonMappingException e) {
} catch (IOException e) {
}
return request;
}
use of org.onap.so.client.sdnc.beans.SDNCRequest 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.so.client.sdnc.beans.SDNCRequest in project so by onap.
the class SDNCHandlerTest method createSDNCRequest.
public SDNCRequest createSDNCRequest() {
SDNCRequest request = new SDNCRequest();
request.setCorrelationName("correlationName");
request.setCorrelationValue("correlationValue");
request.setTopology(SDNCTopology.CONFIGURATION);
ObjectMapper mapper = new ObjectMapper();
try {
GenericResourceApiServiceOperationInformation sdncReq = mapper.readValue(Files.readAllBytes(Paths.get("src/test/resources/SDNC_Client_Request.json")), GenericResourceApiServiceOperationInformation.class);
request.setSDNCPayload(sdncReq);
} catch (JsonParseException e) {
} catch (JsonMappingException e) {
} catch (IOException e) {
}
return request;
}
use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.
the class SDNCActivateTasks method activateNetwork.
/**
* BPMN access method to perform Assign action on SDNC for L3Network
*
* @param execution
* @throws BBObjectNotFoundException
*/
public void activateNetwork(BuildingBlockExecution execution) throws BBObjectNotFoundException {
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.activateNetwork(l3network, serviceInstance, customer, requestContext, cloudRegion);
SDNCRequest sdncRequest = new SDNCRequest();
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.NETWORK);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
Aggregations