public Map<String, String> build() {
    Map<String, String> builder = new HashMap<>();
    configureFileSystem(builder);
    configureNetwork(builder);
    configureCluster(builder);
    configureSecurity(builder);
    configureOthers(builder);
    LOGGER.info("Elasticsearch listening on [HTTP: {}:{}, TCP: {}:{}]",
      builder.get(ES_HTTP_HOST_KEY), builder.get(ES_HTTP_PORT_KEY),
      builder.get(ES_TRANSPORT_HOST_KEY), builder.get(ES_TRANSPORT_PORT_KEY));
    return builder;
  }
@Test
  public void test_default_settings_for_cluster_mode() throws Exception {
    File homeDir = temp.newFolder();
    Props props = new Props(new Properties());
    props.set(SEARCH_PORT.getKey(), "1234");
    props.set(SEARCH_HOST.getKey(), "127.0.0.1");
    props.set(CLUSTER_NODE_SEARCH_HOST.getKey(), "127.0.0.1");
    props.set(CLUSTER_NODE_SEARCH_PORT.getKey(), "1234");
    props.set(CLUSTER_NODE_ES_HOST.getKey(), "127.0.0.1");
    props.set(CLUSTER_NODE_ES_PORT.getKey(), "1234");
    props.set(PATH_HOME.getKey(), homeDir.getAbsolutePath());
    props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
    props.set(PATH_TEMP.getKey(), temp.newFolder().getAbsolutePath());
    props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
    props.set(CLUSTER_NAME.getKey(), "sonarqube-1");
    props.set(Property.CLUSTER_ENABLED.getKey(), "true");
    props.set(CLUSTER_NODE_NAME.getKey(), "node-1");

    EsSettings esSettings = new EsSettings(props, new EsInstallation(props), system);

    Map<String, String> generated = esSettings.build();
    assertThat(generated)
      .containsEntry("cluster.name", "sonarqube-1")
      .containsEntry("node.name", "node-1");
  }