ShardServiceImpl extends AbstractConsoleService<ShardTblDao> implements ShardService { @Override public List<ShardTbl> findAllByClusterName(final String clusterName) { return queryHandler.handleQuery(new DalQuery<List<ShardTbl>>() { @Override public List<ShardTbl> doQuery() throws DalException { return dao.findAllByClusterName(clusterName, ShardTblEntity.READSET_FULL); } }); }  @Override ShardTbl find(final long shardId); @Override ShardTbl find(final String clusterName, final String shardName); @Override List<ShardTbl> findAllByClusterName(final String clusterName); @Override List<ShardTbl> findAllShardNamesByClusterName(final String clusterName); @Override synchronized ShardTbl createShard(final String clusterName, final ShardTbl shard,
											 final Map<Long, SetinelTbl> sentinels); @Override synchronized ShardTbl findOrCreateShardIfNotExist(String clusterName, ShardTbl shard,
															 Map<Long, SetinelTbl> sentinels); @Override void deleteShard(final String clusterName, final String shardName); @Override List<ShardListModel> findAllUnhealthy();  }
@Test public void testFindAllByClusterName(){ List<ShardTbl> allByClusterName = shardService.findAllByClusterName(clusterName); Assert.assertEquals(shardNames.length, allByClusterName.size()); String invalid = randomString(10); allByClusterName = shardService.findAllByClusterName(invalid); Assert.assertEquals(0, allByClusterName.size()); }