Getting Set Up for Testing

About

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

Something went wrong

Lesson added to
playlist

Create new playlist

We've got you covered

At Caster.IO we provide the best hyper focused & bite-sized development training available. Our goal is to
not waste your time, but to give more of it to you. From implementing a new pattern to learning a new technology,
we've got you covered.