Search in sources :

Example 11 with CreateNetworkResponse

use of org.onap.so.adapters.nwrest.CreateNetworkResponse in project so by onap.

the class NetworkAdapterCreateTasksTest method rollbackCreateNetworkTest.

@Test
public void rollbackCreateNetworkTest() throws Exception {
    CreateNetworkResponse createNetworkResponse = new CreateNetworkResponse();
    createNetworkResponse.setNetworkStackId("networkStackId");
    createNetworkResponse.setNetworkCreated(true);
    execution.setVariable("createNetworkResponse", createNetworkResponse);
    Optional<CreateNetworkResponse> oCreateNetworkResponse = Optional.of(createNetworkResponse);
    String cloudRegionPo = "cloudRegionPo";
    execution.setVariable("cloudRegionPo", cloudRegionPo);
    doReturn(oCreateNetworkResponse).when(networkAdapterResources).rollbackCreateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo, createNetworkResponse);
    networkAdapterCreateTasks.rollbackCreateNetwork(execution);
    verify(networkAdapterResources, times(1)).rollbackCreateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo, createNetworkResponse);
}
Also used : CreateNetworkResponse(org.onap.so.adapters.nwrest.CreateNetworkResponse) Test(org.junit.Test)

Aggregations

CreateNetworkResponse (org.onap.so.adapters.nwrest.CreateNetworkResponse)11 Test (org.junit.Test)6 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)4 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 CreateNetworkRequest (org.onap.so.adapters.nwrest.CreateNetworkRequest)2 RollbackNetworkRequest (org.onap.so.adapters.nwrest.RollbackNetworkRequest)2 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)2 OrchestrationContext (org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)2 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)2 ArrayList (java.util.ArrayList)1 JAXBException (javax.xml.bind.JAXBException)1 BaseIntegrationTest (org.onap.so.BaseIntegrationTest)1 DeleteNetworkResponse (org.onap.so.adapters.nwrest.DeleteNetworkResponse)1 RollbackNetworkResponse (org.onap.so.adapters.nwrest.RollbackNetworkResponse)1 UpdateNetworkResponse (org.onap.so.adapters.nwrest.UpdateNetworkResponse)1 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)1 HostRoute (org.onap.so.bpmn.servicedecomposition.bbobjects.HostRoute)1 Subnet (org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet)1