LDAP-266: Finishing up spring-data repository support.
This commit is contained in:
@@ -10,6 +10,7 @@ import org.springframework.ldap.core.support.CountNameClassPairCallbackHandler;
|
||||
import org.springframework.ldap.filter.Filter;
|
||||
import org.springframework.ldap.odm.core.ObjectDirectoryMapper;
|
||||
import org.springframework.ldap.query.LdapQuery;
|
||||
import org.springframework.ldap.repository.support.SimpleLdapRepository;
|
||||
import org.springframework.ldap.support.LdapUtils;
|
||||
|
||||
import javax.naming.Name;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.springframework.ldap.repository.config;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.ldap.config.DummyLdapRepository;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
*/
|
||||
public class AnnotationConfigTest {
|
||||
|
||||
@Test
|
||||
public void testAnnotationConfig() {
|
||||
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/ldap-annotation-config.xml");
|
||||
|
||||
DummyLdapRepository repository = ctx.getBean(DummyLdapRepository.class);
|
||||
assertNotNull(repository);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.springframework.ldap.repository.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
*/
|
||||
@Configuration
|
||||
@EnableLdapRepositories(basePackages = "org.springframework.ldap.config")
|
||||
public class SpringLdapConfiguration {
|
||||
}
|
||||
12
core/src/test/resources/ldap-annotation-config.xml
Normal file
12
core/src/test/resources/ldap-annotation-config.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
|
||||
<ldap:context-source password="apassword" url="ldap://localhost:389" username="uid=admin"/>
|
||||
<ldap:ldap-template />
|
||||
|
||||
<context:component-scan base-package="org.springframework.ldap.repository.config" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user