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 {
422422 protected Response page (String pageName , Response response ) throws ResponseException {
423423 try {
424424 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=" );
426427
427- String pageNumber = parts [parts . length - 1 ];
428+ String pageNumber = parts [1 ]. split ( "&" )[ 0 ];
428429
429430 Request request = response .getRequest ();
430431 Params params = (Params ) request .getParams ().clone ();
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ public class HTTPClientTest {
348348 Request request = mock (Request .class );
349349
350350 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 ();
352352
353353 when (response .getResult ()).thenReturn (jsonObject );
354354 when (response .getRequest ()).thenReturn (request );
You can’t perform that action at this time.
0 commit comments