HostJdbcDao extends JdbcDaoSupport { public boolean isThereAnyHostOnCloudDeactivatedByOurManager() { List<Long> hostsIds = getJdbcTemplate().queryForList(sqlCheckIsThereAnyHostOnCloudDeactivatedByOurManager, Long.class); return CollectionUtils.isNotEmpty(hostsIds); }  HostAdministrationStatus getAdministrationStatus(long hostId); void setAdministrationStatus(HostAdministrationStatus hostAdministrationStatus, long hostId); StartType getStartType(long hostId); Status getStatus(long hostId); ResourceState getResourceState(long hostId); List<HypervisorType> getAllHypervisorsTypeInCloud(); boolean isThereAnyHostOnCloudDeactivatedByOurManager(); boolean isThereAnyHostOnPodDeactivatedByOurManager(long id);  }
@Test public void isThereAnyHostOnCloudDeactivatedByOurManagerTest() { List<Long> hostsIds = new ArrayList<>(); hostsIds.add(0l); configureIsThereAnyHostOnClusterDeactivatedByOurManager(hostsIds); boolean result = spy.isThereAnyHostOnCloudDeactivatedByOurManager(); Mockito.verify(jdbcTemplate).queryForList(Mockito.eq(sqlCheckIsThereAnyHostOnCloudDeactivatedByOurManager), Mockito.eq(Long.class)); Assert.assertEquals(true, result); }
@Test public void isThereAnyHostOnCloudDeactivatedByOurManagerTestEmptyList() { configureIsThereAnyHostOnClusterDeactivatedByOurManager(new ArrayList<Long>()); boolean result = spy.isThereAnyHostOnCloudDeactivatedByOurManager(); Mockito.verify(jdbcTemplate).queryForList(Mockito.eq(sqlCheckIsThereAnyHostOnCloudDeactivatedByOurManager), Mockito.eq(Long.class)); Assert.assertEquals(false, result); }