ClusterDao extends AbstractXpipeConsoleDAO { public List<ClusterTbl> findClustersWithName(List<String> clusterNames) { return queryHandler.handleQuery(new DalQuery<List<ClusterTbl>>() { @Override public List<ClusterTbl> doQuery() throws DalException { return clusterTblDao.findClustersAndOrgWithClusterNames(clusterNames, ClusterTblEntity.READSET_FULL_WITH_ORG); } }); }  @DalTransaction ClusterTbl createCluster(final ClusterTbl cluster); @DalTransaction void updateCluster(ClusterTbl cluster); @DalTransaction void deleteCluster(final ClusterTbl cluster); @DalTransaction int bindDc(final ClusterTbl cluster, final DcTbl dc, SetinelTbl sentinel); @DalTransaction int unbindDc(final ClusterTbl cluster, final DcTbl dc); @DalTransaction ClusterTbl findClusterAndOrgByName(final String clusterName); List<ClusterTbl> findAllClusterWithOrgInfo(); List<ClusterTbl> findClusterWithOrgInfoByClusterType(String type); List<ClusterTbl> findClustersWithOrgInfoByActiveDcId(final long dcId); List<ClusterTbl> findAllByDcId(final long dcId); List<ClusterTbl> findClustersWithName(List<String> clusterNames);  }
@Test public void testFindClustersWithName() throws Exception { List<ClusterTbl> clusters = clusterDao.findClustersWithName(Lists.newArrayList()); Assert.assertTrue(clusters.isEmpty()); clusters = clusterDao.findClustersWithName(Lists.newArrayList("cluster2")); logger.info("clusters: {}", clusters); Assert.assertEquals(1, clusters.size()); clusters = clusterDao.findClustersWithName(Lists.newArrayList("cluster2", "cluster-not-exist")); logger.info("clusters: {}", clusters); Assert.assertEquals(1, clusters.size()); logger.info("{}", clusterDao.findAllClusterWithOrgInfo()); }