DATACMNS-1327 - Prevent int overflow in AbstractPageRequest#getOffset().
Original pull request: #291.
This commit is contained in:
committed by
Oliver Gierke
parent
96c5ff87ef
commit
b7da49f97a
@@ -22,6 +22,7 @@ import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Thomas Darimont
|
||||
* @author Alex Bondarev
|
||||
*/
|
||||
public abstract class AbstractPageRequestUnitTests {
|
||||
|
||||
@@ -75,4 +76,12 @@ public abstract class AbstractPageRequestUnitTests {
|
||||
public void preventsPageSizeLessThanOne() {
|
||||
newPageRequest(0, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getOffsetShouldNotCauseOverflow() {
|
||||
|
||||
AbstractPageRequest request = newPageRequest(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
|
||||
assertThat(request.getOffset()).isGreaterThan(Integer.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user