Testing REST APIs Using MockWebServer | raywenderlich.com

In this MockWebserver Android tutorial, you’ll learn how to mock REST API responses and use Espresso UI tests to check how your app handles success or error responses.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/10091980-testing-rest-apis-using-mockwebserver
1 Like

I cant get the api key the site is not working https://www.potterapi.com/

Hello @subhrajyotisen, I can’t reach the api site

Edit: it does not matter, the article is all about testing, the server response is going to be mocked with mockWebServer, one should just use the .json file from the complete version of the source code and everything should be fine :slight_smile: .

GREAT ARTICLE :fire:

Looks like the ActivityTestRule, jakewharton, and mockwebserver are deprecated.

We are working on an update to this tutorial to use a new API endpoint as well as update the deprecated class.