@Test( expectedExceptions = com.vmware.photon.controller.api.frontend.exceptions.external.VmNotFoundException.class) public void testFailedAttachDiskVmNotFound() throws Exception { when(hostClient.attachDisks(vmId, attachedDiskIds)).thenThrow(VmNotFoundException.class); VmDiskOpStepCmd command = getVmDiskOpStepCmd(Operation.ATTACH_DISK); vm.setAgent("some-agent"); vm.setHost("0.0.0.0"); command.execute(); }