Search in sources :

Example 26 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MsoVnfAdapterImplTest method updateVnfTest_HeatStackNotFound.

@Test
public void updateVnfTest_HeatStackNotFound() throws Exception {
    expectedException.expect(VnfNotFound.class);
    MsoRequest msoRequest = getMsoRequest();
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    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 27 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MsoVnfAdapterImplTest method deleteVnfTest.

@Test
@Ignore
public void deleteVnfTest() throws MsoException {
    Map<String, Object> outputs = new HashMap<>();
    outputs.put("Key1", "value1");
    when(heatUtils.queryStackForOutputs("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12")).thenReturn(outputs);
    MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();
    MsoRequest msoRequest = getMsoRequest();
    try {
        instance.deleteVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", null, msoRequest, new Holder<Map<String, String>>());
    } catch (Exception e) {
    }
    assertNotNull(outputs);
}
Also used : HashMap(java.util.HashMap) MsoRequest(org.onap.so.entity.MsoRequest) HashMap(java.util.HashMap) Map(java.util.Map) ExpectedException(org.junit.rules.ExpectedException) IOException(java.io.IOException) VnfException(org.onap.so.adapters.vnf.exceptions.VnfException) MsoException(org.onap.so.openstack.exceptions.MsoException) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 28 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MsoVnfAdapterImplTest method createVnfTest_ExceptionInGettingNestedHeat.

@Test
public void createVnfTest_ExceptionInGettingNestedHeat() 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").withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
    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 29 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MsoVnfAdapterImplTest method createVnfTest_NestedHeatStatusNotFound.

@Test
public void createVnfTest_NestedHeatStatusNotFound() throws Exception {
    expectedException.expect(VnfException.class);
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenStackGetStackVfModule_404(wireMockServer);
    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 30 with MsoRequest

use of org.onap.so.entity.MsoRequest in project so by onap.

the class MsoVnfAdapterImplTest method updateVnfTest_CloudSiteIdNotFound.

@Test
public void updateVnfTest_CloudSiteIdNotFound() throws Exception {
    expectedException.expect(VnfException.class);
    MsoRequest msoRequest = getMsoRequest();
    Map<String, Object> map = new HashMap<>();
    map.put("key1", "value1");
    instance.updateVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD", "volumeGroupHeatStackId|1", "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