private void turnOnFullAutoOnResource(int resourceId, String dcName, String clusterName) {
    ZkInfo zkInfo = dcsToZkInfo.get(dcName);
    ZKHelixAdmin admin = new ZKHelixAdmin("localhost:" + zkInfo.getPort());
    IdealState idealState = admin.getResourceIdealState(clusterName, String.valueOf(resourceId));
    idealState.setRebalanceMode(IdealState.RebalanceMode.FULL_AUTO);
    int replicaCount = idealState.getPreferenceLists().entrySet().iterator().next().getValue().size();
    idealState.setReplicas(String.valueOf(replicaCount));
    admin.setResourceIdealState(clusterName, String.valueOf(resourceId), idealState);
    admin.close();
  }
Test update partitions that belong to FULL AUTO resource
@throws Exception
ambry-tools/src/integration-test/java/com/github/ambry/clustermap/HelixBootstrapUpgradeToolTest.java