Search in sources :

Example 6 with ElasticsearchConfiguration

use of org.graylog2.configuration.ElasticsearchConfiguration in project graylog2-server by Graylog2.

the class EsNodeProviderTest method singletonListZenUnicastHostsWorks.

@Test
public void singletonListZenUnicastHostsWorks() throws IOException, ValidationException, RepositoryException {
    Map<String, String> settings = ImmutableMap.of("password_secret", "thisisatest", "retention_strategy", "delete", "root_password_sha2", "thisisatest", "elasticsearch_discovery_zen_ping_unicast_hosts", "example.com");
    final ElasticsearchConfiguration config = new ElasticsearchConfiguration();
    new JadConfig(new InMemoryRepository(settings), config).process();
    final Settings nodeSettings = EsNodeProvider.readNodeSettings(config, nodeId);
    assertThat(nodeSettings.getAsArray("discovery.zen.ping.unicast.hosts")).contains("example.com");
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) ElasticsearchConfiguration(org.graylog2.configuration.ElasticsearchConfiguration) Settings(org.elasticsearch.common.settings.Settings) Test(org.junit.Test)

Aggregations

ElasticsearchConfiguration (org.graylog2.configuration.ElasticsearchConfiguration)6 Settings (org.elasticsearch.common.settings.Settings)5 Test (org.junit.Test)5 JadConfig (com.github.joschi.jadconfig.JadConfig)3 InMemoryRepository (com.github.joschi.jadconfig.repositories.InMemoryRepository)3 RepositoryException (com.github.joschi.jadconfig.RepositoryException)1 ValidationException (com.github.joschi.jadconfig.ValidationException)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 File (java.io.File)1 Map (java.util.Map)1