LDAPUnit

LDAPUnit makes it easier to create unit tests for components that are dependent on an LDAP directory servers:

  • DirectoryServerRule is used launch an embedded LDAP directory server so that the unit tests do not have to be dependent on an external LDAP directory server with unpredictable state.
  • DirectoryTester is used to connect to an LDAP directory server (embedded or external) and make assertions about or verify the contents of the LDAP directory.

LDAPUnit relies on UnboundID LDAP SDK to run the embedded LDAP directory server and as the API used to connect to LDAP directory servers.

DirectoryServerRule is based on the OpenDJRule implemented in the https://github.com/ehsavoie/embedded-ldap project.

Examples

To provide you with better understanding of some usages of the LDAPUnit you can take a look at the following examples:

Maven Coordinates

The LDAPUnit has been published in Maven Central at the following coordinates:

<plugin>
    <groupId>com.btmatthews.ldapunit</groupId>
    <artifactId>ldapunit</artifactId>
    <version>1.1.3</version>
</plugin>

Licensing and Source Code

The LDAPUnit is made available under the Apache License and the source code is hosted on GitHub at https://github.com/bmatthews68/ldapunit.