private void checkInstanceInPartition(String dcName, String clusterName, int resourceId, Set<String> partitions,
      String instance, boolean shouldExist) {
    ZkInfo zkInfo = dcsToZkInfo.get(dcName);
    ZKHelixAdmin admin = new ZKHelixAdmin("localhost:" + zkInfo.getPort());
    IdealState idealState = admin.getResourceIdealState(clusterName, String.valueOf(resourceId));
    assertNotNull(idealState);
    for (String partition : partitions) {
      List<String> instances = idealState.getPreferenceList(partition);
      assertEquals(
          "Expect instance " + instance + " to " + (shouldExist ? "exist" : "not exist") + " at resource " + resourceId
              + " for partition " + partition + ". The list is " + instances, shouldExist,
          instances.contains(instance));
    }
    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