Рет қаралды 9,032
Learn Android Unit Testing - MockWebServer allows you to unit test HTTP clients. For instance, you can test Retrofit calls using this mock web server. You can easily test your retrofit calls by creating a mock server that mimics your actual api server. Learn how to unit test your api calls for different scenario like HTTP 4.x.x, 5.x.x errors or timeouts. You can simulate any behavior you want from your api. Setting up mock server is easy using okhttp library provided by square. You can test the behavior of your app based on the api responses.
Setting up mock web server has several advantages - it is cost efficient along with that you can prevent to have rate limiting in apis to run test cases in one go. Development time is also reduced as you can setup your app without any api setup. Learn how to define mock responses and set different responses for your api endpoints.
In this tutorial, we have covered Mock Webserver, JUnit testing in Android. Learn unit testing in Android with simple examples in Kotlin Hindi. Everything is explained in Hindi (हिन्दी)
Topics covered -
1. Complete MVVM Architecture Example Walkthrough
2. MockWebserver in Android
3. Testing Retrofit Calls using Mock
4. Android JUnit Test Cases
Kotlin Flows Playlist -
• Kotlin Flows Tutorials
Jetpack Paging Tutorial -
• Android Paging 3 | Jet...
Complete Dependency Injection Playlist Link -
• Dagger 2 - Dependency ...
Complete Android Architecture Components Playlist -
• Android Architecture C...
Beginner series in Android Playlist (Hindi) -
• Android Tutorials Step...
Kotlin Beginners Tutorial Series -
• Kotlin Beginner Tutori...
For more info - visit the below link
www.cheezycode.com
We are social. Follow us at -
Facebook - / cheezycode
Twitter - / cheezycode
Instagram - / cheezycode