@Test public void config_is_written_correctly_when_one_server() throws IOException { ZookeeperServerConfig.Builder builder = createConfigBuilderForSingleHost(cfgFile, idFile, jksKeyStoreFile); new Configurator(builder.build()).writeConfigToDisk(Optional.empty()); validateConfigFileSingleHost(cfgFile); validateIdFile(idFile, ""); }
void writeConfigToDisk(Optional<TransportSecurityOptions> transportSecurityOptions) { configFilePath.toFile().getParentFile().mkdirs(); try { writeZooKeeperConfigFile(zookeeperServerConfig, transportSecurityOptions); writeMyIdFile(zookeeperServerConfig); transportSecurityOptions.ifPresent(this::writeJksKeystore); } catch (IOException e) { throw new RuntimeException("Error writing zookeeper config", e); } }
Configurator { void writeConfigToDisk(Optional<TransportSecurityOptions> transportSecurityOptions) { configFilePath.toFile().getParentFile().mkdirs(); try { writeZooKeeperConfigFile(zookeeperServerConfig, transportSecurityOptions); writeMyIdFile(zookeeperServerConfig); transportSecurityOptions.ifPresent(this::writeJksKeystore); } catch (IOException e) { throw new RuntimeException("Error writing zookeeper config", e); } } }
Configurator { void writeConfigToDisk(Optional<TransportSecurityOptions> transportSecurityOptions) { configFilePath.toFile().getParentFile().mkdirs(); try { writeZooKeeperConfigFile(zookeeperServerConfig, transportSecurityOptions); writeMyIdFile(zookeeperServerConfig); transportSecurityOptions.ifPresent(this::writeJksKeystore); } catch (IOException e) { throw new RuntimeException("Error writing zookeeper config", e); } } Configurator(ZookeeperServerConfig zookeeperServerConfig); }
Configurator { void writeConfigToDisk(Optional<TransportSecurityOptions> transportSecurityOptions) { configFilePath.toFile().getParentFile().mkdirs(); try { writeZooKeeperConfigFile(zookeeperServerConfig, transportSecurityOptions); writeMyIdFile(zookeeperServerConfig); transportSecurityOptions.ifPresent(this::writeJksKeystore); } catch (IOException e) { throw new RuntimeException("Error writing zookeeper config", e); } } Configurator(ZookeeperServerConfig zookeeperServerConfig);  }
Configurator { void writeConfigToDisk(Optional<TransportSecurityOptions> transportSecurityOptions) { configFilePath.toFile().getParentFile().mkdirs(); try { writeZooKeeperConfigFile(zookeeperServerConfig, transportSecurityOptions); writeMyIdFile(zookeeperServerConfig); transportSecurityOptions.ifPresent(this::writeJksKeystore); } catch (IOException e) { throw new RuntimeException("Error writing zookeeper config", e); } } Configurator(ZookeeperServerConfig zookeeperServerConfig);   }