DATAKV-219 - Adapt to SpEL extension API changes in Spring Data Commons.
Related ticket: DATACMNS-1260.
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.data.keyvalue.repository.query;
|
||||
import static org.hamcrest.core.IsNot.*;
|
||||
import static org.hamcrest.core.IsSame.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -33,8 +34,8 @@ import org.springframework.data.keyvalue.core.KeyValueOperations;
|
||||
import org.springframework.data.keyvalue.core.SpelCriteria;
|
||||
import org.springframework.data.projection.ProjectionFactory;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.query.DefaultEvaluationContextProvider;
|
||||
import org.springframework.data.repository.query.QueryMethod;
|
||||
import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link CachingKeyValuePartTreeQuery}.
|
||||
@@ -62,7 +63,7 @@ public class CachingKeyValuePartTreeQueryUnitTests {
|
||||
QueryMethod qm = new QueryMethod(Repo.class.getMethod("findByFirstname", String.class), metadataMock,
|
||||
projectionFactoryMock);
|
||||
|
||||
KeyValuePartTreeQuery query = new CachingKeyValuePartTreeQuery(qm, DefaultEvaluationContextProvider.INSTANCE,
|
||||
KeyValuePartTreeQuery query = new CachingKeyValuePartTreeQuery(qm, QueryMethodEvaluationContextProvider.DEFAULT,
|
||||
kvOpsMock, SpelQueryCreator.class);
|
||||
|
||||
Object[] args = new Object[] { "foo" };
|
||||
|
||||
@@ -36,8 +36,8 @@ import org.springframework.data.keyvalue.core.SpelCriteria;
|
||||
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
|
||||
import org.springframework.data.projection.ProjectionFactory;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.query.DefaultEvaluationContextProvider;
|
||||
import org.springframework.data.repository.query.QueryMethod;
|
||||
import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider;
|
||||
|
||||
/**
|
||||
* @author Christoph Strobl
|
||||
@@ -59,7 +59,7 @@ public class KeyValuePartTreeQueryUnitTests {
|
||||
QueryMethod qm = new QueryMethod(Repo.class.getMethod("findByFirstname", String.class), metadataMock,
|
||||
projectionFactoryMock);
|
||||
|
||||
KeyValuePartTreeQuery query = new KeyValuePartTreeQuery(qm, DefaultEvaluationContextProvider.INSTANCE, kvOpsMock,
|
||||
KeyValuePartTreeQuery query = new KeyValuePartTreeQuery(qm, QueryMethodEvaluationContextProvider.DEFAULT, kvOpsMock,
|
||||
SpelQueryCreator.class);
|
||||
|
||||
Object[] args = new Object[] { "foo" };
|
||||
@@ -80,7 +80,7 @@ public class KeyValuePartTreeQueryUnitTests {
|
||||
QueryMethod qm = new QueryMethod(Repo.class.getMethod("findBy", Pageable.class), metadataMock,
|
||||
projectionFactoryMock);
|
||||
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, DefaultEvaluationContextProvider.INSTANCE,
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, QueryMethodEvaluationContextProvider.DEFAULT,
|
||||
kvOpsMock, SpelQueryCreator.class);
|
||||
|
||||
KeyValueQuery<?> query = partTreeQuery.prepareQuery(new Object[] { PageRequest.of(2, 3) });
|
||||
@@ -98,7 +98,7 @@ public class KeyValuePartTreeQueryUnitTests {
|
||||
|
||||
QueryMethod qm = new QueryMethod(Repo.class.getMethod("findTop3By"), metadataMock, projectionFactoryMock);
|
||||
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, DefaultEvaluationContextProvider.INSTANCE,
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, QueryMethodEvaluationContextProvider.DEFAULT,
|
||||
kvOpsMock, SpelQueryCreator.class);
|
||||
|
||||
KeyValueQuery<?> query = partTreeQuery.prepareQuery(new Object[] {});
|
||||
@@ -116,7 +116,7 @@ public class KeyValuePartTreeQueryUnitTests {
|
||||
QueryMethod qm = new QueryMethod(Repo.class.getMethod("findTop3ByFirstname", String.class), metadataMock,
|
||||
projectionFactoryMock);
|
||||
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, DefaultEvaluationContextProvider.INSTANCE,
|
||||
KeyValuePartTreeQuery partTreeQuery = new KeyValuePartTreeQuery(qm, QueryMethodEvaluationContextProvider.DEFAULT,
|
||||
kvOpsMock, SpelQueryCreator.class);
|
||||
|
||||
KeyValueQuery<?> query = partTreeQuery.prepareQuery(new Object[] { "firstname" });
|
||||
|
||||
Reference in New Issue
Block a user