EsConfig implements Serializable { Settings toBasicSettings() { return ImmutableSettings.settingsBuilder() .put("cluster.name", clusterName) .put(additionalConfiguration) .build(); } EsConfig(String clusterName, String[] nodes);  EsConfig(String clusterName, String[] nodes, Map<String, String> additionalConfiguration);   }
@Test public void settingsContainClusterName() throws Exception { EsConfig esConfig = new EsConfig(clusterName, nodes); assertThat(esConfig.toBasicSettings().get("cluster.name"), is(clusterName)); }
@Test public void usesAdditionalConfiguration() throws Exception { Map<String, String> additionalSettings = additionalSettings(); EsConfig esConfig = new EsConfig(clusterName, nodes, additionalSettings); Settings settings = esConfig.toBasicSettings(); assertSettingsContainAllAdditionalValues(settings, additionalSettings); }