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