Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Painless network tests for Android using MockWebServer

Painless network tests for Android using MockWebServer

How to create repeatable and reliable HTTP tests without talking to an external server. A journey from happy paths to awkward scenarios: expected requests, slow-loading responses, errors, etc.

https://github.com/VitorNoVictor/MockWebServerDemo

Vitor Nunes

January 25, 2017
Tweet

Other Decks in Programming

Transcript

  1. MockWebServer ▣ Scriptable web server for testing HTTP clients ▣

    Part of OkHttp library by Square ▣ Exercises the full HTTP stack ▣ It can be used to test any HTTP client
  2. Response Queue The first request is served by the first

    response. Providing responses Dispatcher Handles requests and provides responses using custom logic.
  3. Providing the URL Application Server URL Network client Test Runner

    Test Application Activities etc MockWebServer URL