@Test
  public void testMigrateToPropertyStore() throws Exception {
    // This test is tested only when DataNodeConfigSourceType.INSTANCE_CONFIG. The reason is: PROPERTY_STORE source type
    // already writes dataNodeConfigs to Helix PropertyStore when bootstrapping cluster and creates empty InstanceConfig
    // for each node. Once copied from InstanceConfig, the dataNodeConfig will be overridden to empty.
    assumeTrue(dcStr.equals("all") && dataNodeConfigSourceType == DataNodeConfigSourceType.INSTANCE_CONFIG);
    // build a cluster first with metadata in the instance configs
    long expectedResourceCount =
        (testPartitionLayout.getPartitionLayout().getPartitionCount() - 1) / DEFAULT_MAX_PARTITIONS_PER_RESOURCE + 1;
    writeBootstrapOrUpgrade(expectedResourceCount, false);

    // copy the configs
    HelixBootstrapUpgradeUtil.migrateToPropertyStore(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath,
        CLUSTER_NAME_PREFIX, dcStr);
    // verify that they are present in the property store and that the basic values match expectations
    verifyDataNodeConfigs();
  }
Test migrating instance configs to HelixPropertyStore
ambry-tools/src/integration-test/java/com/github/ambry/clustermap/HelixBootstrapUpgradeToolTest.java