Search in sources :

Example 11 with VduInstance

use of org.onap.so.adapters.vdu.VduInstance in project so by onap.

the class MsoHeatUtilsITTest method deleteVduTest.

@Test
public void deleteVduTest() throws Exception {
    VduInstance expected = new VduInstance();
    expected.setVduInstanceId("name/stackId");
    expected.setVduInstanceName("instanceId");
    VduStatus status = new VduStatus();
    status.setState(VduStateType.DELETED);
    expected.setStatus(status);
    CloudInfo cloudInfo = new CloudInfo();
    cloudInfo.setCloudSiteId("mtn13");
    cloudInfo.setTenantId("tenantId");
    String instanceId = "instanceId";
    int timeoutInMinutes = 1;
    StubOpenStack.mockOpenStackResponseAccess(wireMockServer, wireMockPort);
    wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/instanceId")).willReturn(aResponse().withBodyFile("OpenstackResponse_StackId.json").withStatus(HttpStatus.SC_OK)));
    StubOpenStack.mockOpenStackDelete(wireMockServer, "name/da886914-efb2-4917-b335-c8381528d90b");
    wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/name/da886914-efb2-4917-b335-c8381528d90b")).willReturn(aResponse().withBodyFile("OpenstackResponse_Stack_DeleteComplete.json").withStatus(HttpStatus.SC_OK)));
    VduInstance actual = heatUtils.deleteVdu(cloudInfo, instanceId, timeoutInMinutes);
    assertThat(actual, sameBeanAs(expected));
}
Also used : CloudInfo(org.onap.so.adapters.vdu.CloudInfo) VduInstance(org.onap.so.adapters.vdu.VduInstance) VduStatus(org.onap.so.adapters.vdu.VduStatus) Test(org.junit.Test) BaseTest(org.onap.so.BaseTest)

Example 12 with VduInstance

use of org.onap.so.adapters.vdu.VduInstance in project so by onap.

the class MsoMulticloudUtilsTest method deleteVdu.

@Test
public void deleteVdu() throws VduException {
    CloudInfo cloudInfo = new CloudInfo("cloudSiteId", "cloudOwner", "tenantId", "tenantName");
    VduInstance vduInstance = multicloudUtils.deleteVdu(cloudInfo, "instanceId", 3);
    assertNotNull(vduInstance);
    assertTrue(VduStateType.DELETED == vduInstance.getStatus().getState());
}
Also used : CloudInfo(org.onap.so.adapters.vdu.CloudInfo) VduInstance(org.onap.so.adapters.vdu.VduInstance) Test(org.junit.Test) BaseTest(org.onap.so.BaseTest)

Aggregations

VduInstance (org.onap.so.adapters.vdu.VduInstance)12 CloudInfo (org.onap.so.adapters.vdu.CloudInfo)8 VduException (org.onap.so.adapters.vdu.VduException)6 Test (org.junit.Test)4 BaseTest (org.onap.so.BaseTest)4 VduPlugin (org.onap.so.adapters.vdu.VduPlugin)4 VnfException (org.onap.so.adapters.vnf.exceptions.VnfException)4 VduStatus (org.onap.so.adapters.vdu.VduStatus)3 MsoException (org.onap.so.openstack.exceptions.MsoException)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 PluginAction (org.onap.so.adapters.vdu.PluginAction)2 VduModelInfo (org.onap.so.adapters.vdu.VduModelInfo)2 StackInfo (org.onap.so.openstack.beans.StackInfo)2 MsoOpenstackException (org.onap.so.openstack.exceptions.MsoOpenstackException)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 OpenStackConnectException (com.woorea.openstack.base.client.OpenStackConnectException)1 OpenStackResponseException (com.woorea.openstack.base.client.OpenStackResponseException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1