How to unit test Retrofit api calls?
I am trying to integrate Unit test cases for every chunk of code possible. But I am facing issues while adding test cases for api calls that are made through retrofit. The JUnit compiler never executes the code in the CallBack functions . There is another option of making all the api calls Synchronous for testing purpose, but that's not possible for every case in my app. How can I sort this out? I have to add test cases in the api calls by any means. maciekjanusz I test my Retrofit callbacks using Mockito, Robolectric and Hamcrest libraries. First of all, set up lib stack in your module's