I have a data-driven Android app scaffold. Adding tests, aiming for 100% coverage. Using OkHttp.
How do I transparently intercept calls to my server with mock responses?
Want this for—end-to-end as well as—unit tests. E.g.: setting build-type to MockServer
should load an app that will show mock responses in the emulator.
Did you look into okhttp mockwebserver?
I use it for mocking responses and verifying/showing requests.
If you want to use this with a build type, you can generate an Android resource or java constant in gradle and then start the server and set the path accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With