use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfDataPathIsNotReadable.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfDataPathIsNotReadable() throws Exception {
final File path = temporaryFolder.newFolder("elasticsearch-data");
assumeTrue(path.setReadable(false));
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathData() {
return path.getAbsolutePath();
}
};
new JadConfig(new InMemoryRepository(), configuration).process();
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method processValidProperties.
private Configuration processValidProperties() throws RepositoryException, ValidationException {
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
return configuration;
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method leaderElectionTTLTimeoutTooShort.
@Test
public void leaderElectionTTLTimeoutTooShort() {
validProperties.put("leader_election_mode", "automatic");
validProperties.put("lock_service_lock_ttl", "3s");
assertThatThrownBy(() -> {
new JadConfig(new InMemoryRepository(validProperties), new Configuration()).process();
}).isInstanceOf(ValidationException.class).hasMessageStartingWith("The minimum valid \"lock_service_lock_ttl\" is");
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class PathConfigurationTest method testAllowedAuxiliaryPaths.
@Test
public void testAllowedAuxiliaryPaths() throws ValidationException, RepositoryException {
validProperties.put("allowed_auxiliary_paths", "/permitted-dir,/another-valid-dir");
PathConfiguration configuration = new PathConfiguration();
final JadConfig jadConfig = new JadConfig(new InMemoryRepository(validProperties), configuration);
jadConfig.process();
assertEquals(2, configuration.getAllowedAuxiliaryPaths().size());
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class PathConfigurationTest method testBaseConfiguration.
@Test
public void testBaseConfiguration() throws ValidationException, RepositoryException {
PathConfiguration configuration = new PathConfiguration();
final JadConfig jadConfig = new JadConfig(new InMemoryRepository(validProperties), configuration);
jadConfig.process();
assertEquals(BIN_PATH, configuration.getBinDir().toString());
assertEquals(DATA_PATH, configuration.getDataDir().toString());
assertEquals(PLUGINS_PATH, configuration.getPluginDir().toString());
assertTrue(configuration.getAllowedAuxiliaryPaths().isEmpty());
}
Aggregations