Sometimes it is necessary to have a detailed view on the HTTP requests sent by your Android app and also inspect the responses from the server. With a few steps, it is quite easily possible to do this:
Schlagwort: HTTP
Testing HTTP requests on Android using Robolectric
With Robolectric you can not only mock HTTP responses for your code, but you can also test which HTTP requests your code sends. To do this, you can easily use either one of the static methods provided in the Robolectric class or you can use methods of the FakeHTTPLayer.
Testing HTTP requests on Android using Robolectric weiterlesen