Search in sources :

Example 21 with SDNCRequest

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

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

the class SDNCChangeAssignTasksTest method changeModelVnfTest.

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

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

the class SDNCDeactivateTaskTest method deactivateVnfTest.

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

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

the class SDNCDeactivateTaskTest method test_deactivateNetwork.

@Test
public void test_deactivateNetwork() throws Exception {
    doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources).deactivateNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
    sdncDeactivateTasks.deactivateNetwork(execution);
    verify(sdncNetworkResources, times(1)).deactivateNetwork(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 25 with SDNCRequest

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

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