Upgrade to Spring Data Hopper
See gh-380
This commit is contained in:
@@ -3,6 +3,8 @@ package org.springframework.ldap.repository.query;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.projection.ProjectionFactory;
|
||||
import org.springframework.data.projection.SpelAwareProxyProjectionFactory;
|
||||
import org.springframework.data.repository.core.support.DefaultRepositoryMetadata;
|
||||
import org.springframework.ldap.core.LdapTemplate;
|
||||
import org.springframework.ldap.odm.core.impl.BaseUnitTestPerson;
|
||||
@@ -17,6 +19,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
* @author Eddu Melendez
|
||||
*/
|
||||
@ContextConfiguration("classpath:/query-test.xml")
|
||||
public class PartTreeLdapRepositoryQueryTest extends AbstractJUnit4SpringContextTests {
|
||||
@@ -26,12 +29,14 @@ public class PartTreeLdapRepositoryQueryTest extends AbstractJUnit4SpringContext
|
||||
private Class<?> targetClass;
|
||||
private Class<?> entityClass;
|
||||
private DefaultRepositoryMetadata repositoryMetadata;
|
||||
private ProjectionFactory factory;
|
||||
|
||||
@Before
|
||||
public void prepareTest() {
|
||||
entityClass = UnitTestPerson.class;
|
||||
targetClass = UnitTestPersonRepository.class;
|
||||
repositoryMetadata = new DefaultRepositoryMetadata(targetClass);
|
||||
factory = new SpelAwareProxyProjectionFactory();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -155,7 +160,7 @@ public class PartTreeLdapRepositoryQueryTest extends AbstractJUnit4SpringContext
|
||||
}
|
||||
|
||||
private void assertFilterAndBaseForMethod(Method targetMethod, String expectedFilter, String expectedBase, Object... expectedParams) {
|
||||
LdapQueryMethod queryMethod = new LdapQueryMethod(targetMethod, repositoryMetadata);
|
||||
LdapQueryMethod queryMethod = new LdapQueryMethod(targetMethod, repositoryMetadata, factory);
|
||||
PartTreeLdapRepositoryQuery tested = new PartTreeLdapRepositoryQuery(queryMethod, entityClass, ldapTemplate);
|
||||
|
||||
LdapQuery query = tested.createQuery(expectedParams);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package org.springframework.ldap.repository.support;
|
||||
|
||||
import com.mysema.query.types.Path;
|
||||
import com.mysema.query.types.PathMetadata;
|
||||
import com.mysema.query.types.path.EntityPathBase;
|
||||
import com.mysema.query.types.path.ListPath;
|
||||
import com.mysema.query.types.path.PathInits;
|
||||
import com.mysema.query.types.path.StringPath;
|
||||
import com.querydsl.core.types.Path;
|
||||
import com.querydsl.core.types.PathMetadata;
|
||||
import com.querydsl.core.types.dsl.EntityPathBase;
|
||||
import com.querydsl.core.types.dsl.ListPath;
|
||||
import com.querydsl.core.types.dsl.PathInits;
|
||||
import com.querydsl.core.types.dsl.StringPath;
|
||||
import org.springframework.ldap.odm.core.impl.UnitTestPerson;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
import static com.mysema.query.types.PathMetadataFactory.forVariable;
|
||||
import static com.querydsl.core.types.PathMetadataFactory.forVariable;
|
||||
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ public class QPerson extends EntityPathBase<UnitTestPerson> {
|
||||
super(path.getType(), path.getMetadata());
|
||||
}
|
||||
|
||||
public QPerson(PathMetadata<?> metadata) {
|
||||
public QPerson(PathMetadata metadata) {
|
||||
super(UnitTestPerson.class, metadata);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.ldap.repository.support;
|
||||
|
||||
import com.mysema.query.types.Expression;
|
||||
import com.querydsl.core.types.Expression;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.ldap.filter.Filter;
|
||||
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
* @author Eddu Melendez
|
||||
*/
|
||||
public class QueryDslFilterGeneratorTest {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user