@Test(enabled = true, dependsOnMethods = "testLifeCycle")
public void testConfigure() throws InterruptedException, ExecutionException, TimeoutException, IOException {
vApp = api.getVApp(vApp.getHref());
Task task = api.configureVApp(vApp, changeNameTo("eduardo").changeMemoryTo(1536).changeProcessorCountTo(1)
.addDisk(25 * 1048576).addDisk(25 * 1048576));
assert successTester.apply(task.getHref());
vApp = api.getVApp(vApp.getHref());
assertEquals(vApp.getName(), "eduardo");
assertEquals(find(vApp.getResourceAllocations(), CIMPredicates.resourceTypeIn(ResourceType.PROCESSOR))
.getVirtualQuantity().longValue(), 1);
assertEquals(find(vApp.getResourceAllocations(), CIMPredicates.resourceTypeIn(ResourceType.MEMORY))
.getVirtualQuantity().longValue(), 1536);
assertEquals(size(filter(vApp.getResourceAllocations(), CIMPredicates.resourceTypeIn(ResourceType.DISK_DRIVE))),
3);
assert successTester.apply(api.powerOnVApp(vApp.getHref()).getHref());
loopAndCheckPass();
assert successTester.apply(api.powerOffVApp(vApp.getHref()).getHref());
// extract the disks on the vApp sorted by addressOnParent
List<ResourceAllocationSettingData> disks = Lists.newArrayList(filter(vApp.getResourceAllocations(),
CIMPredicates.resourceTypeIn(ResourceType.DISK_DRIVE)));
// delete the second disk
task = api.configureVApp(vApp,
deleteDiskWithAddressOnParent(Integer.parseInt(disks.get(1).getAddressOnParent())));
assert successTester.apply(task.getHref());
assert successTester.apply(api.powerOnVApp(vApp.getHref()).getHref());
loopAndCheckPass();
}