Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using apacheDS for unit test

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?

like image 230
David Portabella Avatar asked Dec 21 '22 22:12

David Portabella


1 Answers

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
like image 70
Terry Gardner Avatar answered Jan 01 '23 23:01

Terry Gardner