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"));
}
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);
}
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());
}
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);
}
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);
}
Aggregations