use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testPasswordSecretIsTooShort.
@Test
public void testPasswordSecretIsTooShort() throws ValidationException, RepositoryException {
validProperties.put("password_secret", "too short");
expectedException.expect(ValidationException.class);
expectedException.expectMessage("The minimum length for \"password_secret\" is 16 characters.");
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 testRestListenUriIsAbsoluteURI.
@Test
public void testRestListenUriIsAbsoluteURI() throws RepositoryException, ValidationException {
validProperties.put("rest_listen_uri", "http://www.example.com:12900/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getRestListenUri()).isEqualTo(URI.create("http://www.example.com:12900/"));
}
use of com.github.joschi.jadconfig.JadConfig in project graylog2-server by Graylog2.
the class ConfigurationTest method testWebInterfaceListeningOnWildcardOnSamePortAsRestApi.
@Test
public void testWebInterfaceListeningOnWildcardOnSamePortAsRestApi() throws ValidationException, RepositoryException {
validProperties.put("rest_listen_uri", "http://127.0.0.1:9000/api/");
validProperties.put("web_listen_uri", "http://0.0.0.0:9000/");
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Wildcard IP addresses cannot be used if the Graylog REST API and web interface listen on the same port.");
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 testWebListenUriIsRelativeURI.
@Test
public void testWebListenUriIsRelativeURI() throws RepositoryException, ValidationException {
validProperties.put("web_listen_uri", "/foo");
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Parameter web_listen_uri should be an absolute URI (found /foo)");
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 testPasswordSecretIsValid.
@Test
public void testPasswordSecretIsValid() throws ValidationException, RepositoryException {
validProperties.put("password_secret", "abcdefghijklmnopqrstuvwxyz");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getPasswordSecret()).isEqualTo("abcdefghijklmnopqrstuvwxyz");
}
Aggregations