DcClusterShardServiceImpl extends AbstractConsoleService<DcClusterShardTblDao> implements DcClusterShardService { @Override public void updateDcClusterShard(DcClusterShardTbl dcClusterShardTbl) throws DalException{ dao.updateByPK(dcClusterShardTbl, DcClusterShardTblEntity.UPDATESET_FULL); }  @Override DcClusterShardTbl find(final long dcClusterId, final long shardId); @Override DcClusterShardTbl find(final String dcName, final String clusterName, final String shardName); @Override List<DcClusterShardTbl> findAllByDcCluster(final long dcClusterId); @Override List<DcClusterShardTbl> findAllByDcCluster(final String dcName, final String clusterName); @Override void updateDcClusterShard(DcClusterShardTbl dcClusterShardTbl); @Override List<DcClusterShardTbl> findAllByDcId(long dcId); @Override List<DcClusterShardTbl> findAllByDcIdAndInClusterTypes(long dcId, Set<String> clusterTypes);  }
@Test public void testUpdateDcClusterShard() throws Exception { DcClusterShardTbl proto = service.find(dcNames[0], clusterName, shardNames[0]); long sentinelId = proto.getSetinelId(); long expected = sentinelId + 1; proto.setSetinelId(expected); service.updateDcClusterShard(proto); Assert.assertEquals(expected, service.find(dcNames[0], clusterName, shardNames[0]).getSetinelId()); }