fobo66’s articles about coding stuff
Mocking network requests with RetrofitMock
Hello! Some time ago I stumbled upon a library inside Square’s brilliant Retrofit repository called retrofit-mock that allows you to build dummy Retrofit clients for usage in tests without OkHttp’s MockWebServer or adding mocking library like Mockito or Mockk. Thing is, it’s not documented well, and it was a bit of a challenge to set it up and make it work, but the end result works quite well. So, I decided to write this article with some introduction for the retrofit-mock usage....