

If you’re looking for an in depth guide on WireMock, I highly recommend that. I learned about WireMock thanks to Sam Edwards at Droidcon NYC 2017, where he goes in depth to explain how WireMock can be used to mock HTTP APIs.
#MOCKWEBSERVER ENQUEUE MULTIPLE ANDROID#
WireMock is an HTTP mocking tool that allows you to run an HTTP server right on your Android device, that you app can communicate with instead of talking to your own server. When I first started this endeavor, I tried WireMock. It turns out, though, that’s not a big problem at all! What Tool Should I Use? We don’t use Dagger or other dependency injection frameworks right now, and a lot of our network code is tightly coupled to the Application class. if liking a user will result in a mutual match even if my test doesn’t expect it to.įor the OkCupid app, mocking the network layer seemed like a particularly challenging task.if only user cards will appear (as opposed to ads or special announcements).which user will appear first in the card stack.Without mocking the network, I have no idea:

Let’s consider testing DoubleTake in OkCupid (this is the main screen where you slide user cards left/right to vote on them). Without doing so, your tests may be inconsistent.

There are plenty of guides, including the official Espresso docs that help you get started automating your app, but if you want to write reliable UI tests you need to mock your networking layer. Three times a year OkCupid developers get to put our daily responsibilities to the side and enjoy “Hack Week”, an entire work week that lets us pursue problems we want to tackle with more freedom to explore and learn.
