Fixed missing application of Pageable handed to query methods using query derivation from the method name.

This commit is contained in:
Oliver Gierke
2011-01-20 01:48:09 +01:00
parent b9b245df5e
commit b6767afadc
2 changed files with 19 additions and 7 deletions

View File

@@ -67,6 +67,7 @@ public class UserRepositoryFinderTests {
secondUser = new User();
secondUser.setEmailAddress("bar");
secondUser.setLastname("foo");
secondUser.setFirstname("foobar");
userRepository.save(secondUser);
}
@@ -117,8 +118,7 @@ public class UserRepositoryFinderTests {
public void executesPagingMethodToPageCorrectly() throws Exception {
Page<User> page =
userRepository
.findByFirstname(new PageRequest(0, 20), "foobar");
userRepository.findByFirstname(new PageRequest(0, 1), "foobar");
assertEquals(1, page.getNumberOfElements());
}
@@ -127,8 +127,7 @@ public class UserRepositoryFinderTests {
public void executesPagingMethodToListCorrectly() throws Exception {
List<User> list =
userRepository
.findByFirstname("foobar", new PageRequest(0, 20));
userRepository.findByFirstname("foobar", new PageRequest(0, 1));
assertThat(list.size(), is(1));
}
}