How To Test API Response With MockWebServer Library The Right Way

Nowadays, writing test cases for every feature of your app has become inevitable! It ensures the app’s correctness, behaviour, and usability at any given moment. For unit & integration testing, Android supports multiple frameworks. Recently we were working on an Android application that was full of API calls. Most of them were nested or getting called at the same time. To achieve maximum code coverage, we decided to write test cases that include API calls. For obvious reasons, it's not a good practice to call the actual API for test cases. After exploring a lot of libraries, we found