Ejemplo n.º 1
0
  @Test(
      description = "PUT /vApp/{id}/operatingSystemSection",
      dependsOnMethods = {"testGetOperatingSystemSection", "testEditVirtualHardwareSection"})
  public void testEditOperatingSystemSection() {
    // Create new OperatingSystemSection
    OperatingSystemSection newSection =
        OperatingSystemSection.builder()
            .info("") // NOTE Required
            // OVF field,
            // ignored
            .id(OSType.RHEL_64.getCode())
            .osType("rhel5_64Guest")
            .build();

    // The method under test
    Task editOperatingSystemSection = vmApi.editOperatingSystemSection(vmUrn, newSection);
    assertTrue(
        retryTaskSuccess.apply(editOperatingSystemSection),
        String.format(TASK_COMPLETE_TIMELY, "editOperatingSystemSection"));

    // Retrieve the modified section
    OperatingSystemSection modified = vmApi.getOperatingSystemSection(vmUrn);

    // Check the retrieved object is well formed
    checkOperatingSystemSection(modified);

    // Check the modified section fields are set correctly
    assertEquals(modified.getId(), newSection.getId());
  }
Ejemplo n.º 2
0
  public static OperatingSystemSection getOperatingSystemSection() {
    OperatingSystemSection section = OperatingSystemSection.builder().build();

    return section;
  }