Search in sources :

Example 66 with JadConfig

use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.

the class MongoDbConfigurationTest method validateSucceedsIfUriIsValid.

@Test
public void validateSucceedsIfUriIsValid() throws Exception {
    MongoDbConfiguration configuration = new MongoDbConfiguration();
    final Map<String, String> properties = singletonMap("mongodb_uri", "mongodb://example.com:1234,127.0.0.1:5678/TEST");
    new JadConfig(new InMemoryRepository(properties), configuration).process();
    assertEquals("mongodb://example.com:1234,127.0.0.1:5678/TEST", configuration.getMongoClientURI().toString());
}
Also used : JadConfig(com.github.joschi.jadconfig.JadConfig) InMemoryRepository(com.github.joschi.jadconfig.repositories.InMemoryRepository) Test(org.junit.Test)

Aggregations

JadConfig (com.github.joschi.jadconfig.JadConfig)66 InMemoryRepository (com.github.joschi.jadconfig.repositories.InMemoryRepository)65 Test (org.junit.Test)64 File (java.io.File)19 ElasticsearchConfiguration (org.graylog2.configuration.ElasticsearchConfiguration)3 Settings (org.elasticsearch.common.settings.Settings)2 RepositoryException (com.github.joschi.jadconfig.RepositoryException)1 ValidationException (com.github.joschi.jadconfig.ValidationException)1 HashMap (java.util.HashMap)1 PluginLoaderConfig (org.graylog2.plugin.PluginLoaderConfig)1