To test with MockWebServer, you need to set up your app to talk to the real server normally, but switch to MockWebServer during testing.
In this lesson you will learn:
How to test Retrofit with MockWebServer
Quick review of how to use OkHttpIdlingResource to wait for Retrofit to complete its network calls
How to use a custom test runner to instantiate a different Application during test
How to have the test application return the MockWebServer base url for Retrofit to use
How to enqueue a response to MockWebServer in your Espresso test