}
@Test(groups = { "live", "user" }, description = "POST /vApp/{id}/action/recomposeVApp")
public void testRecomposeVApp() {
VApp composedVApp = vdcApi.composeVApp(vdcUrn, ComposeVAppParams.builder()
.name(name("composed-"))
.instantiationParams(instantiationParams())
.build());
Set<Vm> vms = getAvailableVMsFromVAppTemplate(vAppTemplate);
// get the first vm to be added to vApp
Vm toAddVm = Iterables.get(vms, 0);
// TODO clean up network config of the vm
//cleanUpNetworkConnectionSection(toAddVm);
RecomposeVAppParams params = addRecomposeParams(composedVApp, toAddVm);
// The method under test
Task recomposeVApp = vAppApi.recompose(composedVApp.getId(), params);
assertTaskSucceedsLong(recomposeVApp);
// remove a vm
VApp configured = vAppApi.get(composedVApp.getId());
List<Vm> vmsToBeDeleted = configured.getChildren().getVms();
Vm toBeDeleted = Iterables.find(vmsToBeDeleted, new Predicate<Vm>() {
@Override
public boolean apply(Vm vm) {
return vm.getName().startsWith("vm-");