DATACMNS-867 - Cleanups in Pageable API.
Dropped Pageable.NONE in favor of ….unpaged() for consistency with Sort.unsorted(). Extracted the implementation for the value backing it into an Unpaged enum instance. Introduced defaulted isPaged() / isUnpaged() to avoid having to compare instances. JavaDoc in Sort and a couple of API polishes.
This commit is contained in:
@@ -72,7 +72,7 @@ public class PageImplUnitTests {
|
||||
|
||||
assertThat(page.isFirst()).isTrue();
|
||||
assertThat(page.hasPrevious()).isFalse();
|
||||
assertThat(page.previousPageable()).isEqualTo(Pageable.NONE);
|
||||
assertThat(page.previousPageable().isPaged()).isFalse();
|
||||
|
||||
assertThat(page.isLast()).isFalse();
|
||||
assertThat(page.hasNext()).isTrue();
|
||||
@@ -90,7 +90,7 @@ public class PageImplUnitTests {
|
||||
|
||||
assertThat(page.isLast()).isTrue();
|
||||
assertThat(page.hasNext()).isFalse();
|
||||
assertThat(page.nextPageable()).isEqualTo(Pageable.NONE);
|
||||
assertThat(page.nextPageable().isPaged()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -158,7 +158,7 @@ public class PageImplUnitTests {
|
||||
@Test // DATACMNS-713
|
||||
public void doesNotAdapttotalIfPageIsEmpty() {
|
||||
|
||||
assertThat(new PageImpl<>(Collections.<String>emptyList(), PageRequest.of(1, 10), 0).getTotalElements())
|
||||
assertThat(new PageImpl<>(Collections.<String> emptyList(), PageRequest.of(1, 10), 0).getTotalElements())
|
||||
.isEqualTo(0L);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user