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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user