Skip to content

Commit

Permalink
Rebased against Neo4jWithSocket settings changes
Browse files Browse the repository at this point in the history
Reverted some of the changes in LdapAuthenticationIT to minimize differences and reduce code conflict against other PRs
  • Loading branch information
craigtaverner committed Sep 14, 2016
1 parent 34afe6f commit 55b5d08
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 74 deletions.
Expand Up @@ -26,6 +26,7 @@
import org.junit.Test;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Consumer;

Expand Down Expand Up @@ -67,12 +68,26 @@
public class ActiveDirectoryAuthenticationIT
{
@Rule
public Neo4jWithSocket server = new Neo4jWithSocket( getTestGraphDatabaseFactory(), getSettingsFunction() );
public Neo4jWithSocket server =
new Neo4jWithSocket( getClass(), getTestGraphDatabaseFactory(), asSettings( getSettingsFunction() ) );

private void restartNeo4jServerWithOverriddenSettings( Consumer<Map<Setting<?>,String>> overrideSettingsFunction )
throws IOException
{
server.restartDatabase( overrideSettingsFunction );
server.shutdownDatabase();
server.ensureDatabase( asSettings( overrideSettingsFunction ) );
}

private Consumer<Map<String,String>> asSettings( Consumer<Map<Setting<?>,String>> overrideSettingsFunction )
{
return settings -> {
Map<Setting<?>,String> o = new LinkedHashMap<>();
overrideSettingsFunction.accept( o );
for ( Setting key : o.keySet() )
{
settings.put( key.name(), o.get( key ) );
}
};
}

protected TestGraphDatabaseFactory getTestGraphDatabaseFactory()
Expand Down

0 comments on commit 55b5d08

Please sign in to comment.