DataDirConfigChangeHandler implements ConfigChangeHandler { @Override public void apply(Configuration change) { String dataDirectoryName = change.getKey(); String dataDirectoryPath = change.getValue().get(); dataDirsConfig.addDataDirectory(dataDirectoryName, dataDirectoryPath); } DataDirConfigChangeHandler(DataDirsConfig dataDirsConfig, IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver); @Override void validate(NodeContext baseConfig, Configuration change); @Override void apply(Configuration change); boolean overLaps(Path existing, Path newDataDirPath);  }
@Test public void testApplyChange() { DataDirsConfig dataDirsConfig = mock(DataDirsConfig.class); DataDirConfigChangeHandler dataDirConfigChangeHandler = new DataDirConfigChangeHandler(dataDirsConfig, identity(), new PathResolver(tmpDir.getRoot())); dataDirConfigChangeHandler.apply(set.toConfiguration(topology.getCluster())); verify(dataDirsConfig).addDataDirectory("new-root", "path/to/data/root"); }