machine.attachDevice(controllerName, controllerPort, deviceSlot, DeviceType.HardDisk, hardDisk);
expectLastCall().andThrow(isoAttachedException);
replay(manager, machine, vBox, hardDisk);
StorageController controller = StorageController.builder()
.name(controllerName)
.bus(StorageBus.IDE)
.attachHardDisk(HardDisk.builder().diskpath("/Users/mattias/jclouds-virtualbox-test/testadmin.vdi")
.controllerPort(controllerPort).deviceSlot(deviceSlot).build())
.build();
DeviceDetails deviceDetails = getOnlyElement(controller.getHardDisks()).getDeviceDetails();
new AttachMediumToMachineIfNotAlreadyAttached(deviceDetails, hardDisk, controllerName).apply(machine);
verify(machine);
}