use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method createVnfTest_HeatEnvironment_ContainsParameters.
@Test
public void createVnfTest_HeatEnvironment_ContainsParameters() throws Exception {
expectedException.expect(VnfException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_404(wireMockServer);
wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/volumeGroupHeatStackId")).willReturn(aResponse().withBodyFile("OpenstackResponse_Stack_Created_VfModule.json").withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/baseVfHeatStackId")).willReturn(aResponse().withBodyFile("OpenstackResponse_Stack_Created_VfModule.json").withStatus(HttpStatus.SC_OK)));
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>());
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method getMsoRequest.
private MsoRequest getMsoRequest() {
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
return msoRequest;
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method createVnfTest_NestedBaseHeatStatus_NotFound.
@Test
public void createVnfTest_NestedBaseHeatStatus_NotFound() throws Exception {
expectedException.expect(VnfException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_404(wireMockServer);
wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/volumeGroupHeatStackId")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("OpenstackResponse_Stack_Created_VfModule.json").withStatus(HttpStatus.SC_OK)));
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>());
}
use of org.onap.so.entity.MsoRequest in project so by onap.
the class MsoVnfAdapterImplTest method updateVnfTest_UpdateStackException.
@Test
public void updateVnfTest_UpdateStackException() 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_OK, "OpenstackResponse_Stack_Created_VfModule.json");
VfModuleCustomization vfModuleCustomization = getVfModuleCustomization();
vfModuleCustomization.getVfModule().getModuleHeatTemplate().setParameters(new HashSet<>());
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 updateVnfTest_MissingParams.
@Test
public void updateVnfTest_MissingParams() 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_OK, "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>());
}
Aggregations