diff --git a/src/main/java/org/springframework/data/redis/core/RedisQueryEngine.java b/src/main/java/org/springframework/data/redis/core/RedisQueryEngine.java index c2c002024..6834d92e3 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisQueryEngine.java +++ b/src/main/java/org/springframework/data/redis/core/RedisQueryEngine.java @@ -45,6 +45,7 @@ import org.springframework.util.CollectionUtils; * * @author Christoph Strobl * @author Mark Paluch + * @author Zhongning Fan * @since 1.7 */ class RedisQueryEngine extends QueryEngine> { diff --git a/src/test/java/org/springframework/data/redis/repository/RedisRepositoryIntegrationTestBase.java b/src/test/java/org/springframework/data/redis/repository/RedisRepositoryIntegrationTestBase.java index 92e483739..4c49b215d 100644 --- a/src/test/java/org/springframework/data/redis/repository/RedisRepositoryIntegrationTestBase.java +++ b/src/test/java/org/springframework/data/redis/repository/RedisRepositoryIntegrationTestBase.java @@ -18,13 +18,13 @@ package org.springframework.data.redis.repository; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; -import java.io.Serializable; +import lombok.Data; + import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; -import lombok.Data; import org.hamcrest.core.IsNull; import org.junit.Before; import org.junit.Test; @@ -53,6 +53,7 @@ import org.springframework.data.repository.PagingAndSortingRepository; * * @author Christoph Strobl * @author Mark Paluch + * @author Zhongning Fan */ public abstract class RedisRepositoryIntegrationTestBase { @@ -354,16 +355,16 @@ public abstract class RedisRepositoryIntegrationTestBase { Person robb = new Person("robb", "stark"); Person sansa = new Person("sansa", "stark"); - repo.save(Arrays.asList(eddard, robb, sansa)); + repo.saveAll(Arrays.asList(eddard, robb, sansa)); - Page page1 = repo.findByFirstnameAndLastname("sansa", "stark", new PageRequest(0, 2)); + Page result = repo.findByFirstnameAndLastname("sansa", "stark", new PageRequest(0, 2)); - assertThat(page1.getNumberOfElements(), is(1)); - assertThat(page1.getContent(), hasSize(1)); - assertThat(page1.getTotalElements(), is(1L)); + assertThat(result.getNumberOfElements(), is(1)); + assertThat(result.getContent(), hasSize(1)); + assertThat(result.getTotalElements(), is(1L)); } - public static interface PersonRepository extends PagingAndSortingRepository { + interface PersonRepository extends PagingAndSortingRepository { List findByFirstname(String firstname); @@ -388,7 +389,7 @@ public abstract class RedisRepositoryIntegrationTestBase { List findByHometownLocationNear(Point point, Distance distance); } - public static interface CityRepository extends CrudRepository { + interface CityRepository extends CrudRepository { List findByLocationNear(Point point, Distance distance); }