use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldBeAbleToOverrideHttpsListenAddressWithJustOneParameter.
@Test
public void shouldBeAbleToOverrideHttpsListenAddressWithJustOneParameter() throws Exception {
// given
Config config = Config.embeddedDefaults(stringMap("dbms.connector.https.enabled", "true", "dbms.connector.https.listen_address", ":8000"));
// then
assertEquals(1, config.enabledHttpConnectors().size());
HttpConnector httpConnector = config.enabledHttpConnectors().get(0);
assertEquals(new ListenSocketAddress("localhost", 8000), config.get(httpConnector.listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldBeAbleToOverrideBoltListenAddressesWithJustOneParameter.
@Test
public void shouldBeAbleToOverrideBoltListenAddressesWithJustOneParameter() throws Exception {
// given
Config config = Config.embeddedDefaults(stringMap("dbms.connector.bolt.enabled", "true", "dbms.connector.bolt.listen_address", ":8000"));
BoltConnector boltConnector = config.boltConnectors().get(0);
// then
assertEquals(new ListenSocketAddress("localhost", 8000), config.get(boltConnector.listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldDeriveBoltListenAddressFromDefaultListenAddress.
@Test
public void shouldDeriveBoltListenAddressFromDefaultListenAddress() throws Exception {
// given
Config config = Config.embeddedDefaults(stringMap("dbms.connector.bolt.enabled", "true", "dbms.connectors.default_listen_address", "0.0.0.0"));
BoltConnector boltConnector = config.boltConnectors().get(0);
// then
assertEquals(new ListenSocketAddress("0.0.0.0", 7687), config.get(boltConnector.listen_address));
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldDeriveListenAddressFromDefaultListenAddressAndSpecifiedPorts.
@Test
public void shouldDeriveListenAddressFromDefaultListenAddressAndSpecifiedPorts() throws Exception {
// given
Config config = Config.embeddedDefaults(stringMap("dbms.connector.https.enabled", "true", "dbms.connector.http.enabled", "true", "dbms.connectors.default_listen_address", "0.0.0.0", "dbms.connector.http.listen_address", ":8000", "dbms.connector.https.listen_address", ":9000"));
// then
assertEquals(2, config.enabledHttpConnectors().size());
config.enabledHttpConnectors().forEach(c -> {
if (c.key().equals("https")) {
assertEquals(new ListenSocketAddress("0.0.0.0", 9000), config.get(c.listen_address));
} else {
assertEquals(new ListenSocketAddress("0.0.0.0", 8000), config.get(c.listen_address));
}
});
}
use of org.neo4j.helpers.ListenSocketAddress in project neo4j by neo4j.
the class GraphDatabaseSettingsTest method shouldDeriveBoltListenAddressFromDefaultListenAddressAndSpecifiedPort.
@Test
public void shouldDeriveBoltListenAddressFromDefaultListenAddressAndSpecifiedPort() throws Exception {
// given
Config config = Config.embeddedDefaults(stringMap("dbms.connectors.default_listen_address", "0.0.0.0", "dbms.connector.bolt.enabled", "true", "dbms.connector.bolt.listen_address", ":8000"));
BoltConnector boltConnector = config.boltConnectors().get(0);
// then
assertEquals(new ListenSocketAddress("0.0.0.0", 8000), config.get(boltConnector.listen_address));
}
Aggregations