@@ -101,7 +101,7 @@ public void testInvalidPaginationWithNullItems() throws IOException {
101101 public void testInvalidPaginationWithNullPage () throws IOException {
102102 assertInvalidPaginatedData (null );
103103 }
104-
104+
105105 private void assertInvalidPaginatedData (String responseBody ) throws IOException {
106106 Runnable call1 = () -> when (getResponse ().getBody ()).thenReturn (responseBody );
107107 PaginatedData <String , PageWrapper <String , RecordPage >,
@@ -161,8 +161,8 @@ public void testCursorPaginationData() throws IOException, CoreApiException {
161161 Runnable call3 = () -> when (getResponse ().getBody ()).thenReturn (
162162 "{\" data\" :[]}" );
163163
164- List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 , call3 ,
165- new CursorPagination ("$response.body#/page_info" ,
164+ List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 ,
165+ call3 , new CursorPagination ("$response.body#/page_info" ,
166166 "$request.path#/cursor" )));
167167
168168 assertTrue (pages .get (0 ).isCursorPagination ());
@@ -208,13 +208,13 @@ public void testOffsetPaginationData() throws IOException, CoreApiException {
208208 Runnable call3 = () -> when (getResponse ().getBody ()).thenReturn (
209209 "{\" data\" :[]}" );
210210
211- List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 , call3 ,
212- new OffsetPagination ("$request.headers#/offset" )));
211+ List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 ,
212+ call3 , new OffsetPagination ("$request.headers#/offset" )));
213213
214214 assertTrue (pages .get (0 ).isOffsetPagination ());
215215 assertEquals (0 , pages .get (0 ).getOffsetInput ());
216216 assertTrue (pages .get (1 ).isOffsetPagination ());
217- assertEquals (3 , pages .get (1 ).getOffsetInput ());
217+ assertEquals (PAGE_SIZE , pages .get (1 ).getOffsetInput ());
218218 }
219219
220220 @ Test
@@ -246,8 +246,8 @@ public void testPagePaginationData() throws IOException, CoreApiException {
246246 Runnable call3 = () -> when (getResponse ().getBody ()).thenReturn (
247247 "{\" data\" :[]}" );
248248
249- List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 , call3 ,
250- new PagePagination ("$request.query#/page" )));
249+ List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 ,
250+ call3 , new PagePagination ("$request.query#/page" )));
251251
252252 assertTrue (pages .get (0 ).isNumberPagination ());
253253 assertEquals (1 , pages .get (0 ).getPageInput ());
@@ -284,8 +284,8 @@ public void testMultiPaginationData() throws IOException, CoreApiException {
284284 Runnable call3 = () -> when (getResponse ().getBody ()).thenReturn (
285285 "{\" data\" :[]}" );
286286
287- List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 , call3 ,
288- new LinkPagination ("$response.INVALID#/next_link" ),
287+ List <PageWrapper <String , RecordPage >> pages = verifyData (getPaginatedData (call1 , call2 ,
288+ call3 , new LinkPagination ("$response.INVALID#/next_link" ),
289289 new PagePagination ("$request.body#/limit" )));
290290
291291 assertTrue (pages .get (0 ).isLinkPagination ());
@@ -384,7 +384,8 @@ public void testMultiPaginationDataAsync()
384384 assertEquals (0 , paginatedData .getItems (itemCreator ).size ());
385385 }
386386
387- private List <PageWrapper <String , RecordPage >> verifyData (PaginatedData <String , PageWrapper <String , RecordPage >,
387+ private List <PageWrapper <String , RecordPage >> verifyData (
388+ PaginatedData <String , PageWrapper <String , RecordPage >,
388389 RecordPage , CoreApiException > paginatedData ) throws CoreApiException , IOException {
389390 Iterator <CheckedSupplier <String , CoreApiException >> itemIterator =
390391 paginatedData .items (cs -> cs );
@@ -407,7 +408,7 @@ private List<PageWrapper<String, RecordPage>> verifyData(PaginatedData<String, P
407408 assertEquals ("No more items available." , exception .getMessage ());
408409
409410 List <PageWrapper <String , RecordPage >> pages = new ArrayList <>();
410-
411+
411412 Iterator <CheckedSupplier <PageWrapper <String , RecordPage >, CoreApiException >> pagesIterator =
412413 paginatedData .pages (cs -> cs );
413414
@@ -437,7 +438,7 @@ private List<PageWrapper<String, RecordPage>> verifyData(PaginatedData<String, P
437438
438439 exception = assertThrows (NoSuchElementException .class , pagesIterator ::next );
439440 assertEquals ("No more pages available." , exception .getMessage ());
440-
441+
441442 return pages ;
442443 }
443444
0 commit comments