use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class BaseConfigurationTest method webTlsValidationFailsIfPrivateKeyIsMissing.
@Test
public void webTlsValidationFailsIfPrivateKeyIsMissing() throws Exception {
final File privateKey = temporaryFolder.newFile("graylog.key");
final File certificate = temporaryFolder.newFile("graylog.crt");
validProperties.put("web_enable_tls", "true");
validProperties.put("web_tls_key_file", privateKey.getAbsolutePath());
validProperties.put("web_tls_cert_file", certificate.getAbsolutePath());
assertThat(privateKey.delete()).isTrue();
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Unreadable or missing web interface private key: ");
new JadConfig(new InMemoryRepository(validProperties), new Configuration()).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class BaseConfigurationTest method restTlsValidationFailsIfPrivateKeyIsMissing.
@Test
public void restTlsValidationFailsIfPrivateKeyIsMissing() throws Exception {
final File privateKey = temporaryFolder.newFile("graylog.key");
final File certificate = temporaryFolder.newFile("graylog.crt");
validProperties.put("rest_enable_tls", "true");
validProperties.put("rest_tls_key_file", privateKey.getAbsolutePath());
validProperties.put("rest_tls_cert_file", certificate.getAbsolutePath());
assertThat(privateKey.delete()).isTrue();
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Unreadable or missing REST API private key: ");
new JadConfig(new InMemoryRepository(validProperties), new Configuration()).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class BaseConfigurationTest method restTlsValidationFailsIfCertificateIsMissing.
@Test
public void restTlsValidationFailsIfCertificateIsMissing() throws Exception {
final File privateKey = temporaryFolder.newFile("graylog.key");
final File certificate = temporaryFolder.newFile("graylog.crt");
validProperties.put("rest_enable_tls", "true");
validProperties.put("rest_tls_key_file", privateKey.getAbsolutePath());
validProperties.put("rest_tls_cert_file", certificate.getAbsolutePath());
assertThat(certificate.delete()).isTrue();
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Unreadable or missing REST API X.509 certificate: ");
new JadConfig(new InMemoryRepository(validProperties), new Configuration()).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class CmdLineTool method getPluginPath.
private String getPluginPath(String configFile) {
final PluginLoaderConfig pluginLoaderConfig = new PluginLoaderConfig();
processConfiguration(new JadConfig(getConfigRepositories(configFile), pluginLoaderConfig));
return pluginLoaderConfig.getPluginDir();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ElasticsearchConfigurationTest method throwValidationExceptionIfHomePathIsNotADirectory.
@Test(expected = ValidationException.class)
public void throwValidationExceptionIfHomePathIsNotADirectory() throws Exception {
final File path = temporaryFolder.newFile("elasticsearch-home");
final ElasticsearchConfiguration configuration = new ElasticsearchConfiguration() {
@Override
public String getPathHome() {
return path.getAbsolutePath();
}
};
new JadConfig(new InMemoryRepository(), configuration).process();
}
Aggregations