private void verifyCdRom(CdRom cdrom) {
   assertNotNull(cdrom);
   assertEquals(cdrom.getId(), CDROM_ID);
   assertNotNull(cdrom.getVm());
   assertEquals(cdrom.getVm().getId(), VM_ID);
   verifyLinks(cdrom);
 }
  @Test
  public void testCdRomAdd() throws Exception {
    PowerShellCdRomsResource cdromResource =
        new PowerShellCdRomsResource(VM_ID, poolMap, resource.new CdRomQuery(VM_ID), uriProvider);

    CdRom cdrom = new CdRom();
    cdrom.setFile(new File());
    cdrom.getFile().setId(ISO_NAME);

    String command = MessageFormat.format(UPDATE_CDROM_CMD, VM_ID, ISO_NAME);

    setUriInfo(setUpCmdExpectations(command, "", "cdroms", CDROM_ID));

    verifyCdRom((CdRom) cdromResource.add(cdrom).getEntity());
  }
  @Test
  public void testCdRomUpdate() throws Exception {
    PowerShellCdRomsResource cdromsResource =
        new PowerShellCdRomsResource(VM_ID, poolMap, resource.new CdRomQuery(VM_ID), uriProvider);

    PowerShellDeviceResource<CdRom, CdRoms> cdromResource =
        cdromsResource.getDeviceSubResource(CDROM_ID);

    CdRom cdrom = new CdRom();
    cdrom.setFile(new File());
    cdrom.getFile().setId(ISO_NAME);

    String command = MessageFormat.format(UPDATE_CDROM_CMD, VM_ID, ISO_NAME);

    setUriInfo(
        setUpCmdExpectations(new String[] {command}, new String[] {""}, "cdroms", CDROM_ID, false));

    verifyCdRom(cdromResource.update(cdrom));
  }