}
@Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
public void testEditGuestCustomizationSection() {
// Copy existing section and edit fields
GuestCustomizationSection oldSection = vmApi.getGuestCustomizationSection(vmUrn);
GuestCustomizationSection newSection = oldSection.toBuilder().computerName(name("n")).enabled(Boolean.TRUE)
.adminPassword(null) // Not allowed
.build();
// The method under test
Task editGuestCustomizationSection = vmApi.editGuestCustomizationSection(vmUrn, newSection);
assertTrue(retryTaskSuccess.apply(editGuestCustomizationSection),
String.format(TASK_COMPLETE_TIMELY, "editGuestCustomizationSection"));
// Retrieve the modified section
GuestCustomizationSection modified = vmApi.getGuestCustomizationSection(vmUrn);
// Check the retrieved object is well formed
checkGuestCustomizationSection(modified);
// Check the modified section fields are set correctly
assertEquals(modified.getComputerName(), newSection.getComputerName());
assertTrue(modified.isEnabled());
// Reset the admin password in the retrieved GuestCustomizationSection for equality check
modified = modified.toBuilder().adminPassword(null).build();
// Check the section was modified correctly
assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "GuestCustomizationSection"));
}