Many times, Android developers need to start implementing features even when the backend is not ready yet. An easier way is to ask the backend developer to create the API service and just send fake content for the sake of it. The underlying notion is that we are not backend developers and it is not our responsibility to provide the endpoint.
They say ‘fake it till you make it’. In this article, we’ll explore the option which involves using Interceptors offered by OkHttp to mock an API response. It’ll allow you to test your Retrofit REST service interface without changing anything on the code.
If it sounds interesting, you can read the original article on medium!