@Test
public void shouldCallSearchManagedEntityAndReturnVMForDoItGetVirtualMachineById()
throws RemoteException {
VSphereServiceConnectionWithMockedInventoryNavigator service =
new VSphereServiceConnectionWithMockedInventoryNavigator();
InventoryNavigator inventoryNavigatorMock = service.getInventoryNavigatorMock();
VirtualMachine vmMock = mock(VirtualMachine.class);
when(inventoryNavigatorMock.searchManagedEntity(VIRTUAL_MACHINE_TYPE_NAME, "instanceId")).thenReturn(vmMock);
VirtualMachine actualVM = service.getVirtualMachineById("instanceId");
verify(inventoryNavigatorMock).searchManagedEntity(VIRTUAL_MACHINE_TYPE_NAME, "instanceId");
assertSame(vmMock, actualVM);