use of org.onap.so.entity.MsoRequest in project so by onap.
the class MSONetworkAdapterImplTest method createNetworkByModelNameHeatModeCreateNetworkException.
@Test
public void createNetworkByModelNameHeatModeCreateNetworkException() throws IOException, NetworkException {
exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStack_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc");
mockOpenstackPost(wireMockServer, "/mockPublicUrl/stacks", 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, false, false, null, null, null, request, stackId, new MutableBoolean());
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method updateVnfTest_NestedHeatStackNotFound.
@Test
public void updateVnfTest_NestedHeatStackNotFound() throws Exception {
expectedException.expect(VnfException.class);
MsoRequest msoRequest = getMsoRequest();
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_200(wireMockServer);
wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/volumeGroupHeatStackId")).willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_NOT_FOUND)));
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId", "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(), new Holder<VnfRollback>());
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method createVnfTest_NullFailIfExists.
@Test
public void createVnfTest_NullFailIfExists() throws Exception {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_200(wireMockServer);
mockUpdateRequestDb(wireMockServer, "12345");
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, null, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>());
assertNotNull(map);
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method updateVnfTest_NestedBaseHeatStackNotFound.
@Test
public void updateVnfTest_NestedBaseHeatStackNotFound() throws Exception {
expectedException.expect(VnfException.class);
MsoRequest msoRequest = getMsoRequest();
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_200(wireMockServer);
mockOpenstackGetWithResponse(wireMockServer, "/mockPublicUrl/stacks/volumeGroupHeatStackId", HttpStatus.SC_OK, "OpenstackResponse_Stack_Created_VfModule.json");
mockOpenstackGetWithResponse(wireMockServer, "/mockPublicUrl/stacks/baseVfHeatStackId", HttpStatus.SC_NOT_FOUND, "OpenstackResponse_Stack_Created_VfModule.json");
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId", "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(), new Holder<VnfRollback>());
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method createVnfTest.
@Test
public void createVnfTest() throws Exception {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_200(wireMockServer);
mockUpdateRequestDb(wireMockServer, "12345");
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>());
assertNotNull(map);
}
Aggregations