Search in sources :

Example 6 with VduStatus

use of org.onap.so.adapters.vdu.VduStatus 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)

Aggregations

VduStatus (org.onap.so.adapters.vdu.VduStatus)6 PluginAction (org.onap.so.adapters.vdu.PluginAction)4 Test (org.junit.Test)3 BaseTest (org.onap.so.BaseTest)3 CloudInfo (org.onap.so.adapters.vdu.CloudInfo)3 VduInstance (org.onap.so.adapters.vdu.VduInstance)3 HeatStatus (org.onap.so.openstack.beans.HeatStatus)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 VduArtifact (org.onap.so.adapters.vdu.VduArtifact)1 VduModelInfo (org.onap.so.adapters.vdu.VduModelInfo)1 VduStateType (org.onap.so.adapters.vdu.VduStateType)1