@Test( description = "PUT /vApp/{id}/productSections", dependsOnMethods = {"testGetProductSections"}) public void testEditProductSections() { powerOffVm(vmUrn); // Copy existing section and edit fields ProductSectionList oldSections = vmApi.getProductSections(vmUrn); ProductSectionList newSections = oldSections .toBuilder() .productSection( ProductSection.builder() .info("Information about the installed software") // Default ovf:Info text .required() .product(MsgType.builder().value("jclouds").build()) .vendor(MsgType.builder().value("jclouds Inc.").build()) // NOTE other ProductSection elements not returned by vCloud .build()) .build(); // The method under test Task editProductSections = vmApi.editProductSections(vmUrn, newSections); assertTrue( retryTaskSuccess.apply(editProductSections), String.format(TASK_COMPLETE_TIMELY, "editProductSections")); // Retrieve the modified section ProductSectionList modified = vmApi.getProductSections(vmUrn); // Check the retrieved object is well formed checkProductSectionList(modified); // Check the modified object has an extra ProductSection assertEquals(modified.getProductSections().size(), oldSections.getProductSections().size() + 1); // Check the section was modified correctly assertEquals(modified, newSections); }
public static ProductSectionList getProductSections() { ProductSectionList sectionItems = ProductSectionList.builder().build(); return sectionItems; }