protected static void setUpConfigurationFiles(final HBaseTestingUtil testUtil) throws Exception {
    // Before this change, the test will update hbase-site.xml under target/test-classes and
    // trigger a config reload. Since target/test-classes/hbase-site.xml is being used by
    // other testing cases at the same time, this update will break other testing cases so it will
    // be flakey in nature.
    // To avoid this, the change is to make target/test-classes/hbase-site.xml immutable. A new
    // hbase-site.xml will be created under its test data directory, i.e,
    // hbase-server/target/test-data/UUID, this new file will be added as a resource for the
    // config, new update will be applied to this new file and only visible to this specific test
    // case. The target/test-classes/hbase-site.xml will not be changed during the test.

    String absoluteDataPath = testUtil.getDataTestDir().toString();

    // Create test-data directories.
    Files.createDirectories(Paths.get(absoluteDataPath));

    // Copy hbase-site.xml from target/test-class to target/test-data/UUID directory.
    Path configFile = Paths.get("target", "test-classes", SERVER_CONFIG);
    configFileUnderTestDataDir = Paths.get(absoluteDataPath, SERVER_CONFIG);
    Files.copy(configFile, configFileUnderTestDataDir);

    // Copy override config file overrider-hbase-site.xml from target/test-class to
    // target/test-data/UUID directory.
    Path overrideConfigFile = Paths.get("target", "test-classes", OVERRIDE_SERVER_CONFIG);
    overrideConfigFileUnderTestDataDir = Paths.get(absoluteDataPath, OVERRIDE_SERVER_CONFIG);
    Files.copy(overrideConfigFile, overrideConfigFileUnderTestDataDir);

    backupConfigFileUnderTestDataDir = Paths.get(absoluteDataPath, BACKUP_SERVER_CONFIG);

    // Add the new custom config file to Configuration
    testUtil.getConfiguration().addResource(testUtil.getDataTestDir(SERVER_CONFIG));
  }
Base class to test Configuration Update logic. It wraps up things needed to test configuration
change and provides utility methods for test cluster setup, updating/restoring configuration
file.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestUpdateConfiguration.java