Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Object[] makeTestCase(int total, int pageSize) {
private Pagination<O, I> makeTestPagination(int pageSize, Supplier<MockInstruction<R>> supplier)
throws Exception {
this.provider.setRequiredOpts();
this.provider.set("limit", Integer.valueOf(pageSize).longValue());
this.provider.set("limit", (long) pageSize);
return makeNewPagination(new MockPagerCloudant<R>(supplier), provider.build());
}

Expand All @@ -235,7 +235,7 @@ private void runPaginationTest(TestCase t,

private void runPaginationErrorTest(Function<Pagination<O, I>, PagingResult<I>> pagingFunction,
MockError error, boolean errorOnFirstPage) throws Exception {
int pageSize = Long.valueOf(OptionsHandler.MAX_LIMIT).intValue();
int pageSize = OptionsHandler.MAX_LIMIT.intValue();
int wholePages = 2;
int expectedItems = wholePages * pageSize;
List<MockInstruction<R>> instructions = new ArrayList<>();
Expand Down Expand Up @@ -283,7 +283,7 @@ public void testValidationEnabled() throws Exception {
Assert.assertThrows("There should be a validation exception", IllegalArgumentException.class,
() -> {
runPaginationTest(
new TestCase(0, Long.valueOf(OptionsHandler.MIN_LIMIT - 1).intValue(), plusOnePaging),
new TestCase(0, Math.toIntExact(OptionsHandler.MIN_LIMIT - 1), plusOnePaging),
p -> null, Collections.emptyList());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ private enum Case {
case BOTH:
responseBuilder.header("x-couch-request-id", MOCK_COUCH_REQ_ID);
responseBuilder.header("x-request-id", MOCK_REQ_ID);
break;
case NONE:
default:
break;
Expand Down