Enqueue is an easy way to tell MockWebServer what to return when it gets a request. However, when the incoming requests are not in a deterministic order, or when you want to derive the response based on the request, you will need to write custom login with Dispatcher.
In this lesson you will learn:
- What happens when you try to enqueue responses for the order of incoming requests are not deterministic. -
- How to set up a Dispatcher for MockWebServer
- How to derive a response from the request in the Dispatcher