use of org.springframework.data.ldap.core.mapping.LdapMappingContext in project spring-data-ldap by spring-projects.
the class PartTreeLdapRepositoryQueryTests method assertFilterAndBaseForMethod.
private void assertFilterAndBaseForMethod(Method targetMethod, String expectedFilter, String expectedBase, Object... expectedParams) {
LdapQueryMethod queryMethod = new LdapQueryMethod(targetMethod, repositoryMetadata, factory);
PartTreeLdapRepositoryQuery tested = new PartTreeLdapRepositoryQuery(queryMethod, entityClass, ldapTemplate, new LdapMappingContext(), new EntityInstantiators());
LdapQuery query = tested.createQuery(new LdapParametersParameterAccessor(queryMethod, expectedParams));
String base = query.base().toString();
assertThat(base).isEqualTo(expectedBase);
assertThat(query.filter().encode()).isEqualTo(expectedFilter);
}
use of org.springframework.data.ldap.core.mapping.LdapMappingContext in project spring-data-ldap by spring-projects.
the class LdapRepositoryFactoryBean method afterPropertiesSet.
/*
* (non-Javadoc)
* @see org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() {
Assert.notNull(ldapOperations, "LdapOperations must be set");
super.afterPropertiesSet();
if (!mappingContextConfigured) {
setMappingContext(new LdapMappingContext());
}
}
use of org.springframework.data.ldap.core.mapping.LdapMappingContext in project spring-data-ldap by spring-projects.
the class QuerydslLdapPredicateExecutorUnitTests method before.
@BeforeEach
void before() throws Exception {
when(ldapOperations.getObjectDirectoryMapper()).thenReturn(new DefaultObjectDirectoryMapper());
repository = new QuerydslLdapPredicateExecutor<>(UnitTestPerson.class, new SpelAwareProxyProjectionFactory(), ldapOperations, new LdapMappingContext());
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");
}
Aggregations