use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method testWebListenUriWithCustomPort.
@Test
public void testWebListenUriWithCustomPort() throws RepositoryException, ValidationException {
validProperties.put("web_listen_uri", "http://example.com:9000/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getWebListenUri()).hasPort(9000);
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method testRestListenUriWithHttpDefaultPort.
@Test
public void testRestListenUriWithHttpDefaultPort() throws RepositoryException, ValidationException {
validProperties.put("rest_listen_uri", "http://example.com/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getRestListenUri()).hasPort(80);
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method testRestListenUriIsRelativeURI.
@Test
public void testRestListenUriIsRelativeURI() throws RepositoryException, ValidationException {
validProperties.put("rest_listen_uri", "/foo");
expectedException.expect(ValidationException.class);
expectedException.expectMessage("Parameter rest_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.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method testWebListenerOnRootAndApiListenerOnSubPath.
@Test
public void testWebListenerOnRootAndApiListenerOnSubPath() throws ValidationException, RepositoryException {
validProperties.put("rest_listen_uri", "http://0.0.0.0:9000/api/");
validProperties.put("web_listen_uri", "http://0.0.0.0:9000/");
Configuration configuration = new Configuration();
new JadConfig(new InMemoryRepository(validProperties), configuration).process();
assertThat(configuration.getRestListenUri()).isEqualTo(URI.create("http://0.0.0.0:9000/api/"));
assertThat(configuration.getWebListenUri()).isEqualTo(URI.create("http://0.0.0.0:9000/"));
}
use of com.github.joschi.jadconfig.repositories.InMemoryRepository in project graylog2-server by Graylog2.
the class ConfigurationTest method testRestApiListeningOnWildcardOnSamePortAsWebInterface.
@Test
public void testRestApiListeningOnWildcardOnSamePortAsWebInterface() throws ValidationException, RepositoryException {
validProperties.put("rest_listen_uri", "http://0.0.0.0:9000/api/");
validProperties.put("web_listen_uri", "http://127.0.0.1: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();
}
Aggregations