KeeperContainerServiceImpl extends AbstractConsoleService<KeepercontainerTblDao> implements KeeperContainerService { @Override public List<KeepercontainerTbl> findAllActiveByDcName(String dcName) { return queryHandler.handleQuery(new DalQuery<List<KeepercontainerTbl>>() { @Override public List<KeepercontainerTbl> doQuery() throws DalException { return dao.findActiveByDcName(dcName, KeepercontainerTblEntity.READSET_FULL); } }); }  @Override KeepercontainerTbl find(final long id); @Override List<KeepercontainerTbl> findAllByDcName(final String dcName); @Override List<KeepercontainerTbl> findAllActiveByDcName(String dcName); @Override List<KeepercontainerTbl> findKeeperCount(String dcName); @Override List<KeepercontainerTbl> findBestKeeperContainersByDcCluster(String dcName, String clusterName); @Override void addKeeperContainer(final KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerCreateInfo> getDcAllKeeperContainers(String dc); @Override void updateKeeperContainer(KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerInfoModel> findAllInfos();  }
@Test public void testFindAllActiveByDcName(){ String dcName = dcNames[0]; List<KeepercontainerTbl> allByDcName = keeperContainerService.findAllByDcName(dcName); int size = allByDcName.size(); Assert.assertTrue(size > 0); for(KeepercontainerTbl keepercontainerTbl : allByDcName){ Assert.assertTrue(keepercontainerTbl.isKeepercontainerActive()); keepercontainerTbl.setKeepercontainerActive(false); keeperContainerService.update(keepercontainerTbl); } List<KeepercontainerTbl> allActiveByDcName = keeperContainerService.findAllActiveByDcName(dcName); Assert.assertEquals(0, allActiveByDcName.size()); allByDcName = keeperContainerService.findAllByDcName(dcName); Assert.assertEquals(size, allByDcName.size()); }