Search in sources :

Example 16 with SDNCRequest

use of org.onap.so.client.sdnc.beans.SDNCRequest 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());
}
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 17 with SDNCRequest

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

the class SDNCActivateTaskTest method activateVnfTest.

@Test
public void activateVnfTest() throws Exception {
    doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    sdncActivateTasks.activateVnf(execution);
    verify(sdncVnfResources, times(1)).activateVnf(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 18 with SDNCRequest

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

the class SDNCDeactivateTaskTest method deactivateServiceInstanceTest.

@Test
public void deactivateServiceInstanceTest() throws Exception {
    doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources).deactivateServiceInstance(serviceInstance, customer, requestContext);
    sdncDeactivateTasks.deactivateServiceInstance(execution);
    verify(sdncServiceInstanceResources, times(1)).deactivateServiceInstance(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 19 with SDNCRequest

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

the class SDNCActivateTaskTest method activateVfModuleTest.

@Test
public void activateVfModuleTest() throws Exception {
    doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).activateVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
    sdncActivateTasks.activateVfModule(execution);
    verify(sdncVfModuleResources, times(1)).activateVfModule(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());
}
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 20 with SDNCRequest

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

the class SDNCActivateTaskTest method activateNetworkTest.

@Test
public void activateNetworkTest() throws Exception {
    doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources).activateNetwork(isA(L3Network.class), isA(ServiceInstance.class), isA(Customer.class), isA(RequestContext.class), isA(CloudRegion.class));
    sdncActivateTasks.activateNetwork(execution);
    verify(sdncNetworkResources, times(1)).activateNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
    SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
    assertEquals(SDNCTopology.NETWORK, sdncRequest.getTopology());
}
Also used : L3Network(org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network) CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) SDNCRequest(org.onap.so.client.sdnc.beans.SDNCRequest) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) GenericResourceApiNetworkOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) 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