Skip to content

Instantly share code, notes, and snippets.

@asyd
Created August 12, 2014 06:44
Show Gist options
  • Save asyd/3c5c70f3e3bc82e6ee86 to your computer and use it in GitHub Desktop.
Save asyd/3c5c70f3e3bc82e6ee86 to your computer and use it in GitHub Desktop.
In memory LDAP Server with unboundid
@BeforeClass()
public void setUp() throws LDAPException {
InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=example,dc=com");
config.addAdditionalBindCredentials("cn=Directory Manager", "password");
directoryServer = new InMemoryDirectoryServer(config);
directoryServer.importFromLDIF(true, getClass().getResource("/00-initial.ldif").getPath());
directoryServer.startListening();
ldapConnection = directoryServer.getConnection();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment