HypervisorManager { protected void shutdown(HostVO hostVo, HypervisorHost currentHypervisorHost) { hostService.loadHostDetails(hostVo); currentHypervisorHost.shutdownHost(hostVo); hostService.markHostAsShutdownByAdministrationAgent(hostVo.getId()); }  void shutdownHost(HostVO hostVo);  }
@Test public void shutdownTest() { HostVO host = new HostVO(""); Mockito.doNothing().when(hostService).loadHostDetails(Mockito.any(HostVO.class)); Mockito.doNothing().when(hypervisor).shutdownHost(Mockito.any(HostVO.class)); Mockito.doNothing().when(hostService).markHostAsShutdownByAdministrationAgent(Mockito.anyLong()); hypervisorManager.shutdown(host, hypervisor); InOrder inOrder = Mockito.inOrder(hostService); inOrder.verify(hostService).loadHostDetails(Mockito.any(HostVO.class)); Mockito.verify(hypervisor).shutdownHost(Mockito.any(HostVO.class)); inOrder.verify(hostService).markHostAsShutdownByAdministrationAgent(Mockito.anyLong()); }