HostService { public HostVO findHostById(Long hostId) { return hostDao.findById(hostId); }  boolean isHostUpAndEnabled(long hostId); boolean isHostInMaintenanceError(long hostId); boolean isHostInPreparedForMaintenance(long hostId); @Transactional(readOnly = false) void markHostAsShutdownByAdministrationAgent(long id); void loadHostDetails(HostVO host); List<HypervisorType> getAllHypervisorsTypeInCloud(); HostVO findHostById(Long hostId); List<HostVO> listAllHostsInCluster(Cluster cluster); List<VMInstanceVO> listAllVmsFromHost(long hostId); @Transactional(readOnly = false) void updateHostPrivaceMacAddress(HostVO hostVo, String privateMacAddress); boolean isHostDown(long id); boolean isThereAnyHostOnCloudDeactivatedByOurManager();  }
@Test public void findHostByIdTest() { HostVO host = new HostVO("guid"); Mockito.doReturn(host).when(hostDao).findById(Mockito.anyLong()); HostVO result = spy.findHostById(0l); Mockito.verify(hostDao).findById(Mockito.anyLong()); Assert.assertEquals(host, result); }