* @see VmApi#remove(String)
*/
@Test(description = "DELETE /vApp/{id}")
public void testRemoveVm() {
// Create a temporary VApp to remove
VApp remove = instantiateVApp();
DeployVAppParams params = DeployVAppParams.builder()
.deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS)).notForceCustomization()
.powerOn().build();
Task deployVApp = vAppApi.deploy(remove.getId(), params);
assertTaskSucceedsLong(deployVApp);
// Get the edited VApp and the Vm
remove = vAppApi.get(remove.getId());
List<Vm> vms = remove.getChildren().getVms();
Vm temp = Iterables.get(vms, 0);
// otherwise it's impossible to stop a running vApp with no vms
if (vms.size() == 1) {
UndeployVAppParams undeployParams = UndeployVAppParams.builder().build();
Task shutdownVapp = vAppApi.undeploy(remove.getId(), undeployParams);
assertTaskSucceedsLong(shutdownVapp);
} else {
powerOffVm(temp.getId());
}
// The method under test