DATACMNS-615 - PageImpl now rejects a total less than the amount of items given.
PageImpl now makes sure that the total given to the constructor is never less than then number of items given to make sure we do not mask broken count calculation by creating an actually invalid instance. Related ticket: DATAMONGO-1120.
This commit is contained in:
@@ -126,4 +126,12 @@ public class PageImplUnitTests {
|
||||
assertThat(page.hasNext(), is(false));
|
||||
assertThat(page.hasPrevious(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-615
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void rejectsTotalLessThanContentLength() {
|
||||
new PageImpl<String>(Arrays.asList("foo", "bar"), new PageRequest(0, 10), 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user