March 5, 2015 at 4:52 pm #3358Gregory WrightParticipant
We’re using OpenDJ to provide the LDAP infrastructure for a project we’re working on, and want to be able to test our LDAP client code against an embedded OpenDJ instance within our Continuous Integration (CI) builds (much like one would test database client code against an embedded database like H2). Unfortunately we haven’t been able to find much in the way of examples of how to do this.
* Java 1.8
* Maven 3.2.5
* Spring Boot 1.2.1
The one “full example” example we have been able to find (https://github.com/ehsavoie/embedded-ldap) appears to use a full-blown installation of OpenDJ server (version 2.4.x). Attempts we’ve made at building the example project using the ForgeRock repositories and the current stable release version have been stymied.
We’d like to be able to just simply pull in opendj-core as discussed on the OpenDJ LDAP SDK wiki page (http://opendj.forgerock.org/opendj-ldap-sdk/), but it isn’t quite clear what configuration files are truly required to spin up a functioning minimal embedded OpenDJ server instance. The “full example” above has many configuration files, but it’s not clear which are actually necessary.
Any direction, including pointers to working examples or documentation would be greatly appreciated.March 5, 2015 at 5:44 pm #3359LudoModerator
It’s been a while since I’ve tried to build an app with an embedded version of OpenDJ. But OpenAM does it in its nightly builds and releases with 2.6 so I’m guessing it’s working fine.
The example provided by Emmanuel (aka ehsavoie) should work, although OpenDJ 2.6.0 has an issue with Java 8 when installing (api to create certificates has changed package in Java 8).
What’s in the OpenDJ LDAP SDK is more of a self contain, very simple in memory example server that we use to test some of the SDK and tools. It seems the javadoc is not fully accurate, but reading the code, it doesn’t need much beyond a listen address and port number, and an LDIF file that contains that to load in the memory backend.
I hope this helps.March 10, 2015 at 3:24 pm #3426Gregory WrightParticipant
Thank you Ludo, the MemoryBackend seems to do the trick, at least for testing our direct interactions with LDAP. The next step will be to see if we can wire it into Spring Security for integration tests.
You must be logged in to reply to this topic.