public void verifyReplication(ZkClient zkClient, String clusterName, String resource, int repl) {
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
Builder keyBuilder = accessor.keyBuilder();
IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resource));
for (String partitionName : idealState.getPartitionSet()) {
if (idealState.getRebalanceMode() == RebalanceMode.SEMI_AUTO) {
AssertJUnit.assertEquals(repl, idealState.getPreferenceList(partitionName).size());
} else if (idealState.getRebalanceMode() == RebalanceMode.CUSTOMIZED) {
AssertJUnit.assertEquals(repl, idealState.getInstanceStateMap(partitionName).size());