Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to test the LDAP authentication in an application.

For authentication we are getting the
Java
InitialDirContext
by passing the hashtable arguments.

Is there a way I can mock this call.

What I have tried:

I tried mocking the InitialDirContext as below.

Java
mock(InitialDirContext.class);


Still it does not work and it is trying to hit the LDAP server.

Any suggestions will be helpful.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900