Search in sources :

Example 11 with Setting

use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.

the class HttpConnectorValidatorTest method setsDeprecationFlagOnType.

@Test
public void setsDeprecationFlagOnType() throws Exception {
    Setting setting = cv.getSettingFor("dbms.connector.http.type", Collections.emptyMap()).orElseThrow(() -> new RuntimeException("missing setting!"));
    assertTrue(setting.deprecated());
    assertEquals(Optional.empty(), setting.replacement());
}
Also used : Setting(org.neo4j.graphdb.config.Setting) Test(org.junit.Test)

Example 12 with Setting

use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.

the class HttpConnectorValidatorTest method setsDeprecationFlagOnCustomNamedHttpsConnectors.

@Test
public void setsDeprecationFlagOnCustomNamedHttpsConnectors() throws Exception {
    List<Setting<Object>> settings = cv.settings(stringMap("dbms.connector.0.type", "HTTP", "dbms.connector.0.enabled", "false", "dbms.connector.0.listen_address", "1.2.3.4:123", "dbms.connector.0.advertised_address", "localhost:123", "dbms.connector.0.encryption", Encryption.TLS.toString()));
    assertEquals(5, settings.size());
    for (Setting s : settings) {
        assertTrue("every setting should be deprecated: " + s.name(), s.deprecated());
        String[] parts = s.name().split("\\.");
        if (!"encryption".equals(parts[3]) && !"type".equals(parts[3])) {
            assertEquals(Optional.of(format("%s.%s.%s.%s", parts[0], parts[1], "https", parts[3])), s.replacement());
        }
    }
}
Also used : Setting(org.neo4j.graphdb.config.Setting) Test(org.junit.Test)

Example 13 with Setting

use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.

the class HttpConnectorValidatorTest method setsDeprecationFlagOnAddress.

@Test
public void setsDeprecationFlagOnAddress() throws Exception {
    Setting setting = cv.getSettingFor("dbms.connector.http.address", Collections.emptyMap()).orElseThrow(() -> new RuntimeException("missing setting!"));
    assertTrue(setting.deprecated());
    assertEquals(Optional.of("dbms.connector.http.listen_address"), setting.replacement());
}
Also used : Setting(org.neo4j.graphdb.config.Setting) Test(org.junit.Test)

Example 14 with Setting

use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.

the class TestGraphDatabaseFactory method newImpermanentDatabase.

public GraphDatabaseService newImpermanentDatabase(Map<Setting<?>, String> config) {
    GraphDatabaseBuilder builder = newImpermanentDatabaseBuilder();
    for (Map.Entry<Setting<?>, String> entry : config.entrySet()) {
        Setting<?> key = entry.getKey();
        String value = entry.getValue();
        builder.setConfig(key, value);
    }
    return builder.newGraphDatabase();
}
Also used : Setting(org.neo4j.graphdb.config.Setting) Map(java.util.Map) MapUtil.stringMap(org.neo4j.helpers.collection.MapUtil.stringMap) GraphDatabaseBuilder(org.neo4j.graphdb.factory.GraphDatabaseBuilder)

Example 15 with Setting

use of org.neo4j.graphdb.config.Setting in project neo4j by neo4j.

the class AuthProceduresIT method createGraphDatabase.

//---------- utility -----------
private GraphDatabaseService createGraphDatabase(EphemeralFileSystemAbstraction fs) throws IOException {
    removePreviousAuthFile();
    Map<Setting<?>, String> settings = new HashMap<>();
    settings.put(GraphDatabaseSettings.auth_enabled, "true");
    TestGraphDatabaseBuilder graphDatabaseFactory = (TestGraphDatabaseBuilder) new TestGraphDatabaseFactory().setFileSystem(fs).newImpermanentDatabaseBuilder().setConfig(GraphDatabaseSettings.auth_enabled, "true");
    return graphDatabaseFactory.newGraphDatabase();
}
Also used : HashMap(java.util.HashMap) Setting(org.neo4j.graphdb.config.Setting) TestGraphDatabaseBuilder(org.neo4j.test.TestGraphDatabaseBuilder) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) Matchers.containsString(org.hamcrest.Matchers.containsString)

Aggregations

Setting (org.neo4j.graphdb.config.Setting)15 Test (org.junit.Test)10 HashMap (java.util.HashMap)4 Field (java.lang.reflect.Field)2 Map (java.util.Map)2 TestGraphDatabaseFactory (org.neo4j.test.TestGraphDatabaseFactory)2 IOException (java.io.IOException)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Statement (org.junit.runners.model.Statement)1 Authentication (org.neo4j.bolt.security.auth.Authentication)1 BasicAuthentication (org.neo4j.bolt.security.auth.BasicAuthentication)1 BoltFactoryImpl (org.neo4j.bolt.v1.runtime.BoltFactoryImpl)1 BoltStateMachine (org.neo4j.bolt.v1.runtime.BoltStateMachine)1 DependencyResolver (org.neo4j.graphdb.DependencyResolver)1 GraphDatabaseBuilder (org.neo4j.graphdb.factory.GraphDatabaseBuilder)1 MapUtil.stringMap (org.neo4j.helpers.collection.MapUtil.stringMap)1 AuthManager (org.neo4j.kernel.api.security.AuthManager)1 UserManagerSupplier (org.neo4j.kernel.api.security.UserManagerSupplier)1 TestGraphDatabaseBuilder (org.neo4j.test.TestGraphDatabaseBuilder)1 UsageData (org.neo4j.udc.UsageData)1