Search in sources :

Example 6 with VnfRollback

use of org.onap.so.openstack.beans.VnfRollback in project so by onap.

the class MsoVnfAdapterImplTest method updateVnfTest.

@Test
public void updateVnfTest() throws Exception {
    MsoRequest msoRequest = getMsoRequest();
    mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    mockOpenstackGetWithResponse(wireMockServer, "/mockPublicUrl/stacks/" + vnfName, HttpStatus.SC_OK, "OpenstackResponse_Stack_UpdateComplete.json");
    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");
    mockOpenStackPutStack(wireMockServer, "null/stackId", HttpStatus.SC_OK);
    mockOpenstackGetWithResponse(wireMockServer, "/mockPublicUrl/stacks/null/stackId", HttpStatus.SC_OK, "OpenstackResponse_Stack_UpdateComplete.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", "b4ea86b4-253f-11e7-93ae-92361f002671", map, msoRequest, new Holder<Map<String, String>>(), new Holder<VnfRollback>());
    assertNotNull(msoRequest);
}
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 7 with VnfRollback

use of org.onap.so.openstack.beans.VnfRollback in project so by onap.

the class MsoVnfAdapterImplTest method updateVnfTest_ExceptionInGettingNestedHeatStack.

@Test
public void updateVnfTest_ExceptionInGettingNestedHeatStack() 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_INTERNAL_SERVER_ERROR)));
    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 8 with VnfRollback

use of org.onap.so.openstack.beans.VnfRollback 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 9 with VnfRollback

use of org.onap.so.openstack.beans.VnfRollback 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)

Example 10 with VnfRollback

use of org.onap.so.openstack.beans.VnfRollback 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)

Aggregations

VnfRollback (org.onap.so.openstack.beans.VnfRollback)11 HashMap (java.util.HashMap)10 Map (java.util.Map)10 Test (org.junit.Test)9 MsoRequest (org.onap.so.entity.MsoRequest)9 VfModuleCustomization (org.onap.so.db.catalog.beans.VfModuleCustomization)3 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayList (java.util.ArrayList)1 VnfException (org.onap.so.adapters.vnf.exceptions.VnfException)1 VnfNotFound (org.onap.so.adapters.vnf.exceptions.VnfNotFound)1 CloudSite (org.onap.so.db.catalog.beans.CloudSite)1 HeatEnvironment (org.onap.so.db.catalog.beans.HeatEnvironment)1 HeatFiles (org.onap.so.db.catalog.beans.HeatFiles)1 HeatTemplate (org.onap.so.db.catalog.beans.HeatTemplate)1 HeatTemplateParam (org.onap.so.db.catalog.beans.HeatTemplateParam)1 VfModule (org.onap.so.db.catalog.beans.VfModule)1 VnfResource (org.onap.so.db.catalog.beans.VnfResource)1 MavenLikeVersioning (org.onap.so.db.catalog.utils.MavenLikeVersioning)1 StackInfo (org.onap.so.openstack.beans.StackInfo)1