Search in sources :

Example 16 with MsoRequest

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<>());
}
Also used : HashMap(java.util.HashMap) MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Example 17 with MsoRequest

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;
}
Also used : MsoRequest(org.onap.so.entity.MsoRequest)

Example 18 with 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<>());
}
Also used : HashMap(java.util.HashMap) MsoRequest(org.onap.so.entity.MsoRequest) Test(org.junit.Test)

Example 19 with MsoRequest

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>());
}
Also used : VnfRollback(org.onap.so.openstack.beans.VnfRollback) HashMap(java.util.HashMap) MsoRequest(org.onap.so.entity.MsoRequest) VfModuleCustomization(org.onap.so.db.catalog.beans.VfModuleCustomization) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.Test)

Example 20 with MsoRequest

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>());
}
Also used : VnfRollback(org.onap.so.openstack.beans.VnfRollback) HashMap(java.util.HashMap) MsoRequest(org.onap.so.entity.MsoRequest) HashMap(java.util.HashMap) Map(java.util.Map) 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