File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -422,9 +422,10 @@ private void write(Request request) throws IOException {
422
422
protected Response page (String pageName , Response response ) throws ResponseException {
423
423
try {
424
424
String [] parts = response .getResult ().get ("meta" ).getAsJsonObject ()
425
- .get ("links" ).getAsJsonObject ().get (pageName ).getAsString ().split ("=" );
425
+ .get ("links" ).getAsJsonObject ().get (pageName ).getAsString ()
426
+ .split ("page%5Boffset%5D=" );
426
427
427
- String pageNumber = parts [parts . length - 1 ];
428
+ String pageNumber = parts [1 ]. split ( "&" )[ 0 ];
428
429
429
430
Request request = response .getRequest ();
430
431
Params params = (Params ) request .getParams ().clone ();
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ public class HTTPClientTest {
348
348
Request request = mock (Request .class );
349
349
350
350
JsonObject jsonObject = new JsonParser ().parse ("{ \" meta\" : { "
351
- + "\" links\" : {\" next\" : \" http://foobar.com?page=10\" } } }" ).getAsJsonObject ();
351
+ + "\" links\" : {\" next\" : \" http://foobar.com?page%5Boffset%5D =10\" } } }" ).getAsJsonObject ();
352
352
353
353
when (response .getResult ()).thenReturn (jsonObject );
354
354
when (response .getRequest ()).thenReturn (request );
You can’t perform that action at this time.
0 commit comments