Integration tests with spring-security and ldap

僤鯓⒐⒋嵵緔 提交于 2019-12-01 06:31:31

Why not take a look at Spring Security's LDAP integration tests and use those as a guide?

At the moment, these just use an LDAP template to clear out data that each test has created if necessary (for speed), but there is also a commented-out Junit @After method which does reload an LDIF file. The CoreSession is obtained by calling getAdminSession() on the server instance (a DefaultDirectoryService).

If you really have to run the tests using an XML application context, using the <ldap-server /> element, you can use:

getBeanByName(BeanIds.EMBEDDED_APACHE_DS).getService()

to get access to the DefaultDirectoryService instance.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!