diff --git a/modules/cloudant/src/test/java/com/ibm/cloud/cloudant/features/pagination/PaginationOperationTest.java b/modules/cloudant/src/test/java/com/ibm/cloud/cloudant/features/pagination/PaginationOperationTest.java index 162b3911d..2375bdae5 100644 --- a/modules/cloudant/src/test/java/com/ibm/cloud/cloudant/features/pagination/PaginationOperationTest.java +++ b/modules/cloudant/src/test/java/com/ibm/cloud/cloudant/features/pagination/PaginationOperationTest.java @@ -218,7 +218,7 @@ Object[] makeTestCase(int total, int pageSize) { private Pagination makeTestPagination(int pageSize, Supplier> supplier) throws Exception { this.provider.setRequiredOpts(); - this.provider.set("limit", Integer.valueOf(pageSize).longValue()); + this.provider.set("limit", (long) pageSize); return makeNewPagination(new MockPagerCloudant(supplier), provider.build()); } @@ -235,7 +235,7 @@ private void runPaginationTest(TestCase t, private void runPaginationErrorTest(Function, PagingResult> 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> instructions = new ArrayList<>(); @@ -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()); }); } diff --git a/modules/common/src/test/java/com/ibm/cloud/cloudant/internal/ErrorTransformInterceptorTest.java b/modules/common/src/test/java/com/ibm/cloud/cloudant/internal/ErrorTransformInterceptorTest.java index d8f267c8b..0bfbd1ad8 100644 --- a/modules/common/src/test/java/com/ibm/cloud/cloudant/internal/ErrorTransformInterceptorTest.java +++ b/modules/common/src/test/java/com/ibm/cloud/cloudant/internal/ErrorTransformInterceptorTest.java @@ -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;