Search in sources :

Example 11 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.

the class SDNCUnassignTasksTest method unassignServiceInstanceTest.

@Test
public void unassignServiceInstanceTest() throws Exception {
    doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources).unassignServiceInstance(serviceInstance, customer, requestContext);
    sdncUnassignTasks.unassignServiceInstance(execution);
    verify(sdncServiceInstanceResources, times(1)).unassignServiceInstance(serviceInstance, customer, requestContext);
    SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
    assertEquals(SDNCTopology.SERVICE, sdncRequest.getTopology());
}
Also used : SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) GenericResourceApiServiceOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 12 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest 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());
}
Also used : SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) GenericResourceApiNetworkOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 13 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.

the class SDNCUnassignTasksTest method unassignVnfTest.

@Test
public void unassignVnfTest() throws Exception {
    doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    sdncUnassignTasks.unassignVnf(execution);
    verify(sdncVnfResources, times(1)).unassignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
    assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
Also used : SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) URI(java.net.URI) GenericResourceApiVnfOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 14 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.

the class SDNCAssignTasksTest method assignVfModuleTest.

@Test
public void assignVfModuleTest() throws Exception {
    doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).assignVfModule(eq(vfModule), eq(volumeGroup), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    sdncAssignTasks.assignVfModule(execution);
    verify(sdncVfModuleResources, times(1)).assignVfModule(eq(vfModule), eq(volumeGroup), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
    assertEquals(SDNCTopology.VFMODULE, sdncRequest.getTopology());
}
Also used : SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) URI(java.net.URI) GenericResourceApiVfModuleOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 15 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest in project so by onap.

the class SDNCAssignTasksTest method assignVnfTest.

@Test
public void assignVnfTest() throws Exception {
    doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
    execution.setVariable("generalBuildingBlock", gBBInput);
    sdncAssignTasks.assignVnf(execution);
    verify(sdncVnfResources, times(1)).assignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
    SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
    assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
Also used : SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) URI(java.net.URI) GenericResourceApiVnfOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Aggregations

SDNCRequest (org.onap.so.client.sdnc.beans.SDNCRequest)41 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)20 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)19 Test (org.junit.Test)17 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)17 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)17 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)16 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)13 URI (java.net.URI)10 GenericResourceApiVfModuleOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation)10 GenericResourceApiVnfOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation)10 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)10 GenericResourceApiNetworkOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation)9 GenericResourceApiServiceOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation)9 BBObjectNotFoundException (org.onap.so.client.exception.BBObjectNotFoundException)7 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)6 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)5 JsonParseException (com.fasterxml.jackson.core.JsonParseException)2 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2