Fixed bug in total page number calculation due to additional root adding.

Using the initially created root to create the count projection now. Added more tests to verify correct number of elements and pages.
This commit is contained in:
Oliver Gierke
2011-02-14 21:44:03 +01:00
parent e5b31d6757
commit cd4013fe1d
4 changed files with 13 additions and 13 deletions

View File

@@ -119,7 +119,9 @@ public class UserRepositoryFinderTests {
Page<User> page =
userRepository.findByFirstname(new PageRequest(0, 1), "foobar");
assertEquals(1, page.getNumberOfElements());
assertThat(page.getNumberOfElements(), is(1));
assertThat(page.getTotalElements(), is(2L));
assertThat(page.getTotalPages(), is(2));
}