@Test
  public void testRollBackFromFullAuto() throws Exception {
    // For aggregated view, it will always return false
    assumeTrue(!useComposite && !useAggregatedView && fullAutoCompatible);
    HelixClusterManager helixClusterManager = (HelixClusterManager) clusterManager;
    verifyInitialClusterChanges(helixClusterManager, helixCluster, helixDcs);

    List<DataNode> allLocalDcDataNodes = testHardwareLayout.getAllDataNodesFromDc(localDc);
    String resourceName = helixCluster.getResources(localDc).get(0);
    IdealState idealState = helixCluster.getResourceIdealState(resourceName, localDc);
    idealState.setRebalanceMode(IdealState.RebalanceMode.FULL_AUTO);
    final String instanceGroupTag = "TAG_1000000";
    idealState.setInstanceGroupTag(instanceGroupTag);
    helixCluster.refreshIdealState();

    // 1. Test data node in full auto
    for (DataNode dataNode : allLocalDcDataNodes) {
      String instanceName = ClusterMapUtils.getInstanceName(dataNode.getHostname(), dataNode.getPort());
      InstanceConfig instanceConfig =
          helixCluster.getHelixAdminFromDc(localDc).getInstanceConfig(helixCluster.getClusterName(), instanceName);
      instanceConfig.addTag(instanceGroupTag);
      assertTrue("Should be on FULL_AUTO", helixClusterManager.isDataNodeInFullAutoMode(dataNode, true));
    }

    // 2. Test data node rollback for a resource present in /AdminConfigs/FullAutoMigration
    String addr = "localhost:" + dcsToZkInfo.get(localDc).getPort();
    HelixPropertyStore<ZNRecord> propertyStore =
        CommonUtils.createHelixPropertyStore(addr, "/" + helixCluster.getClusterName() + "/" + PROPERTYSTORE_STR, null);
    ZNRecord zNRecord = new ZNRecord(FULL_AUTO_MIGRATION_STR);
    zNRecord.setListField(RESOURCES_STR, Collections.singletonList(resourceName));
    propertyStore.set(FULL_AUTO_MIGRATION_ZNODE_PATH, zNRecord, AccessOption.PERSISTENT);
    idealState.setRebalanceMode(IdealState.RebalanceMode.SEMI_AUTO);
    helixCluster.refreshIdealState();
    for (DataNode dataNode : allLocalDcDataNodes) {
      assertTrue("Resource should considered as FULL AUTO while it is rolling back to help with local disk selection",
          helixClusterManager.isDataNodeInFullAutoMode(dataNode, true));
      assertFalse("Resource should considered NOT IN FULL AUTO when not checking the property store",
          helixClusterManager.isDataNodeInFullAutoMode(dataNode, false));
    }
  }
Test {@link ClusterMap#isDataNodeInFullAutoMode} when falling back to semi-auto.
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixClusterManagerTest.java