HostService { public List<HypervisorType> getAllHypervisorsTypeInCloud() { return this.hostDaoJdbc.getAllHypervisorsTypeInCloud(); }  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 getAllHypervisorsTypeInCloudTest() { List<HypervisorType> hypervisors = new ArrayList<>(); hypervisors.add(HypervisorType.XenServer); hypervisors.add(HypervisorType.KVM); Mockito.doReturn(hypervisors).when(hostDaoJdbc).getAllHypervisorsTypeInCloud(); List<HypervisorType> result = spy.getAllHypervisorsTypeInCloud(); Mockito.verify(hostDaoJdbc).getAllHypervisorsTypeInCloud(); Assert.assertEquals(hypervisors.size(), result.size()); Assert.assertEquals(hypervisors.get(0), result.get(0)); Assert.assertEquals(hypervisors.get(1), result.get(1)); }