Search in sources :

Example 21 with MsoRequest

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());
}
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 22 with MsoRequest

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

Example 23 with MsoRequest

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

Example 24 with MsoRequest

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

Example 25 with MsoRequest

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);
}
Also used : HashMap(java.util.HashMap) 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