I am using Espresso to write UI tests for my Android application and would like to mock http requests using MockWebServer.
I need to mock authentication responses and sign
This example of replacing dependency with Dagger. But you can use any other approaches for DI. Main idea - replace dependency during test by providing a "test" version of you application via custom test runner.