use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testApiListenerOnRootAndWebListenerOnSubPath.
@Test
public void testApiListenerOnRootAndWebListenerOnSubPath() throws ValidationException, RepositoryException {
validProperties.put("rest_listen_uri", "http://0.0.0.0:12900/");
validProperties.put("web_listen_uri", "http://0.0.0.0:12900/web/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getRestListenUri()).isEqualTo(URI.create("http://0.0.0.0:12900/"));
assertThat(configuration.getWebListenUri()).isEqualTo(URI.create("http://0.0.0.0:12900/web/"));
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testPasswordSecretIsEmpty.
@Test
public void testPasswordSecretIsEmpty() throws ValidationException, RepositoryException {
validProperties.put("password_secret", "");
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Parameter password_secret should not be blank");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testRestListenUriWithCustomPort.
@Test
public void testRestListenUriWithCustomPort() throws RepositoryException, ValidationException {
validProperties.put("rest_listen_uri", "http://example.com:12900/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getRestListenUri()).hasPort(12900);
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testWebListenUriWithHttpDefaultPort.
@Test
public void testWebListenUriWithHttpDefaultPort() throws RepositoryException, ValidationException {
validProperties.put("web_listen_uri", "http://example.com/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getWebListenUri()).hasPort(80);
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testPasswordSecretIsNull.
@Test
public void testPasswordSecretIsNull() throws ValidationException, RepositoryException {
validProperties.put("password_secret", null);
expectedException.expect(ParameterException.class);
expectedException.expectMessage("Required parameter \"password_secret\" not found.");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
}
Aggregations