Using apacheDS for unit test
apacheds, java, ldap, testing, unit-testing
Solution
Instead of mocking, use the in-memory directory server provided by the UnboundID LDAP SDK. This is a fully-fledged server and its use will result in realistic responses from a directory server, which will lead to more complete testing and more robust code.
see also
- Using the in-memory directory server
- The UnboundID LDAP SDK
Problem
I have an application that uses a LDAP server, and I need to write some unit tests. I started mocking LDAP DirContext and others, but it makes too difficult for my current tests, so I thought I using an embedded LDAP server. This link does not work: http://directory.apache.org/apacheds/1.5/42-using-apacheds-for-unit-tests.html -> Embedding ApacheDS - Conference Materials -> Code Examples (requires Maven 2.x) (SVN) Does anyone have the code example for it or any alternative to ApacheDS?