Search in sources :

Example 6 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class VnfAdapterVfModuleObjectMapperTest method test_deleteVfModuleNoHeatIdRequestMapper.

@Test
public void test_deleteVfModuleNoHeatIdRequestMapper() throws Exception {
    DeleteVfModuleRequest expectedDeleteVfModuleRequest = new DeleteVfModuleRequest();
    CloudRegion cloudRegion = new CloudRegion();
    cloudRegion.setLcpCloudRegionId("lcpCloudRegionId");
    expectedDeleteVfModuleRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
    cloudRegion.setTenantId("tenantId");
    expectedDeleteVfModuleRequest.setTenantId(cloudRegion.getTenantId());
    GenericVnf genericVnf = new GenericVnf();
    VfModule vfModule = new VfModule();
    vfModule.setHeatStackId("heatStackId");
    expectedDeleteVfModuleRequest.setVfModuleStackId("heatStackId");
    expectedDeleteVfModuleRequest.setSkipAAI(true);
    MsoRequest msoRequest = new MsoRequest();
    RequestContext requestContext = new RequestContext();
    requestContext.setMsoRequestId("msoRequestId");
    msoRequest.setRequestId(requestContext.getMsoRequestId());
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    msoRequest.setServiceInstanceId(serviceInstance.getServiceInstanceId());
    expectedDeleteVfModuleRequest.setMsoRequest(msoRequest);
    String messageId = "messageId";
    String endpoint = "endpoint";
    doNothing().when(mapper).setIdAndUrl(any());
    expectedDeleteVfModuleRequest.setMessageId(messageId);
    expectedDeleteVfModuleRequest.setNotificationUrl(endpoint + "/VNFAResponse/" + messageId);
    DeleteVfModuleRequest actualDeleteVfModuleRequest = mapper.deleteVfModuleRequestMapper(requestContext, cloudRegion, serviceInstance, genericVnf, vfModule);
    assertThat(actualDeleteVfModuleRequest, sameBeanAs(expectedDeleteVfModuleRequest).ignoring("messageId").ignoring("notificationUrl"));
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) MsoRequest(org.onap.so.entity.MsoRequest) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) DeleteVfModuleRequest(org.onap.so.adapters.vnfrest.DeleteVfModuleRequest) Test(org.junit.Test)

Example 7 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MSONetworkAdapterImplTest method updateNetworkNeutronStackNotFound.

@Test
public void updateNetworkNeutronStackNotFound() throws IOException, NetworkException {
    exception.expect(NetworkException.class);
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_NOT_FOUND);
    MsoRequest request = new MsoRequest();
    request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
    request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
    Holder<String> stackId = new Holder<String>();
    impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null, "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
Also used : Holder(javax.xml.ws.Holder) MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Example 8 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MSONetworkAdapterImplTest method createNetworkByModelNameHeatModeQueryNetworkException.

@Test
public void createNetworkByModelNameHeatModeQueryNetworkException() throws IOException, NetworkException {
    exception.expect(NetworkException.class);
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenstackGet(wireMockServer, "/mockPublicUrl/stacks/dvspg-VCE_VPE-mtjnj40avbc", HttpStatus.SC_INTERNAL_SERVER_ERROR);
    MsoRequest request = new MsoRequest();
    request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
    request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
    Holder<String> stackId = new Holder<String>();
    impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, true, false, null, null, null, request, stackId, new MutableBoolean());
}
Also used : Holder(javax.xml.ws.Holder) MutableBoolean(org.apache.commons.lang3.mutable.MutableBoolean) MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Example 9 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MSONetworkAdapterImplTest method deleteNetworkHeatModeSuccess.

@Test
public void deleteNetworkHeatModeSuccess() throws IOException, NetworkException {
    mockUpdateRequestDb(wireMockServer, "5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenStackGetStackDeleteOrUpdateComplete_200(wireMockServer, "OpenstackResponse_Stack_DeleteComplete.json");
    mockOpenStackDeleteStack_200(wireMockServer);
    mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
    MsoRequest request = new MsoRequest();
    request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
    request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
    impl.deleteNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, "43173f6a-d699-414b-888f-ab243dda6dfe", request);
}
Also used : MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Example 10 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MSONetworkAdapterImplTest method createNetworkByModelNameHeatMode.

@Test
public void createNetworkByModelNameHeatMode() throws IOException, NetworkException {
    mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenStackGetStack_404(wireMockServer, "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
    mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json");
    mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
    MsoRequest request = new MsoRequest();
    request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
    request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
    Holder<String> stackId = new Holder<String>();
    impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001", "dvs-mtjnj-01", null, null, null, null, false, false, null, null, null, request, stackId, new MutableBoolean());
    assertNotNull(stackId.value);
}
Also used : Holder(javax.xml.ws.Holder) MutableBoolean(org.apache.commons.lang3.mutable.MutableBoolean) MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Aggregations

MsoRequest (org.onap.so.entity.MsoRequest)51 Test (org.junit.Test)44 HashMap (java.util.HashMap)25 Map (java.util.Map)11 Holder (javax.xml.ws.Holder)11 VnfRollback (org.onap.so.openstack.beans.VnfRollback)9 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)6 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)6 MutableBoolean (org.apache.commons.lang3.mutable.MutableBoolean)5 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)5 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)4 VfModuleCustomization (org.onap.so.db.catalog.beans.VfModuleCustomization)4 ArrayList (java.util.ArrayList)3 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)3 HostRoute (org.onap.so.bpmn.servicedecomposition.bbobjects.HostRoute)3 Subnet (org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet)3 VolumeGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup)3 OrchestrationContext (org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)3 ModelInfoNetwork (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork)3 CreateNetworkRequest (org.onap.so.adapters.nwrest.CreateNetworkRequest)2