Search in sources :

Example 1 with LdapRepositoryFactory

use of org.springframework.data.ldap.repository.support.LdapRepositoryFactory in project spring-data-ldap by spring-projects.

the class LdapRepositoryUnitTests method before.

@BeforeEach
void before() throws Exception {
    when(ldapOperations.getObjectDirectoryMapper()).thenReturn(new DefaultObjectDirectoryMapper());
    walter = new UnitTestPerson(new LdapName("cn=walter"), "Walter", "White", Collections.emptyList(), "US", "Heisenberg", "000");
    hank = new UnitTestPerson(new LdapName("cn=hank"), "Hank", "Schrader", Collections.emptyList(), "US", "DEA", "000");
    repository = new LdapRepositoryFactory(ldapOperations).getRepository(PersonRepository.class);
}
Also used : UnitTestPerson(org.springframework.data.ldap.repository.support.UnitTestPerson) DefaultObjectDirectoryMapper(org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper) LdapRepositoryFactory(org.springframework.data.ldap.repository.support.LdapRepositoryFactory) LdapName(javax.naming.ldap.LdapName) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

LdapName (javax.naming.ldap.LdapName)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 LdapRepositoryFactory (org.springframework.data.ldap.repository.support.LdapRepositoryFactory)1 UnitTestPerson (org.springframework.data.ldap.repository.support.UnitTestPerson)1 DefaultObjectDirectoryMapper (org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper)1