-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RESTMock for mocking Retrofit REST services #116
Comments
interesting however there is WireMock : https://github.com/tomakehurst/wiremock,
MockWebServer is also really cool and I use it allot but its power is in full and sequential control of the requests/responses |
I've used Wiremock recently and found it be a decent tool. Although, I was using it a way that more resembled blackbox testing; arguably a special case (at least it seemed that way to me). I think that generally, people should see if MockWebServer is adequate for needs before using WireMock. |
@peter-tackage I agree. MockWebServer with its default dispatcher could be enough for most for the cases and makes you think more about the way/sequence you make network requests which may help in discovering some unexpected side effects. |
Regarding #114, we have been using RESTMock to mock Retrofit calls and it's working like a charm! It uses OkHttp's MockWebServer and it allows to define mock responses for matchers. For instance:
It also permits to verify if the calls have been done.
The text was updated successfully, but these errors were encountered: