jeudi 3 septembre 2015

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 thats not possible for every case in my app.

Can anyone please help me to sort this out. I have to add test cases in the api calls by any means.

Any suggestion for another approach will be also helpful.

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire