expect(vm.getOSTypeId()).andReturn(OS_TYPE_ID).anyTimes();
expect(vm.getMemorySize()).andReturn(MEMORY_SIZE).anyTimes();
replay(vbm, iStorageController, iMediumAttachment, hd, dvd, vm);
VmSpec vmSpec = new IMachineToVmSpec().apply(vm);
assertEquals(vmSpec.getVmName(), VM_NAME);
assertEquals(vmSpec.getVmId(), VM_ID);
assertEquals(vmSpec.getMemory(), MEMORY_SIZE);
for(StorageController controller : vmSpec.getControllers()) {
assertEquals(controller.getName(), CONTROLLER_NAME);
assertEquals(controller.getBus(), CONTROLLER_BUS);
for (HardDisk hardDisk : controller.getHardDisks()) {
assertEquals(hardDisk.getDiskPath(), PATH_TO_HD);
}