Android Unit Testing Retrofit Calls using MockWebServer | CheezyCode Hindi

  Рет қаралды 9,032

Cheezy Code

Cheezy Code

Жыл бұрын

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

Пікірлер: 26
@pranaym143
@pranaym143 Жыл бұрын
Your testing tutorial really helped me a lot. you only explained what is absolutely necessary in android and not random concepts. I was able to write test cases for my app with decent coverage.
@utkarshkumar1080
@utkarshkumar1080 Жыл бұрын
Thank you so much sir for such a great content 🤩🤩😍
@akashsoni2246
@akashsoni2246 7 ай бұрын
I Love you, bro, you really made my day seriously these tuts are awesome
@user-it6pe9kb2q
@user-it6pe9kb2q 13 күн бұрын
this is mock server in case if there is some thing wrong from the real server response or any field changed or increased so how we can test that real server????
@manusarangal449
@manusarangal449 5 ай бұрын
Job well done! 👏
@tinkusony90
@tinkusony90 Жыл бұрын
Thanks sir 🙏🙏🙏
@santoshs490
@santoshs490 Жыл бұрын
Thanks!
@ashokvlogs2024
@ashokvlogs2024 Жыл бұрын
Thank u so much sir
@abhijeetmule1521
@abhijeetmule1521 Жыл бұрын
Nice Video 🙏
@VipinKumar-wb9sw
@VipinKumar-wb9sw 4 ай бұрын
Bhai thank you for this
@BtrmaAbhishekVerma
@BtrmaAbhishekVerma 2 ай бұрын
Can anyone tell me when to use mockito and mock web server/
@nikhilkeshari9176
@nikhilkeshari9176 Жыл бұрын
please make the video of How to test clean architecture use cases?
@abbasalidaruwala
@abbasalidaruwala Жыл бұрын
@Cheezy Code Do you have github link for the repo?
@Mohit-il9gx
@Mohit-il9gx Жыл бұрын
Waiting for your comeback
@SameerKumar-ce9hi
@SameerKumar-ce9hi Жыл бұрын
Thank you so much for this tutorial. Can you just share with me the repository of this tutorial?
@roshan4507
@roshan4507 Жыл бұрын
How to test connectivity manager ? I want to test network connectivity check function. Please share code snippet.
@chitalip
@chitalip Жыл бұрын
can you please post videos on clean architecture
@bhavanamulani
@bhavanamulani Жыл бұрын
Could you please do a video on appAuth.. actual project
@rohangupta2743
@rohangupta2743 Жыл бұрын
Sir please writes End-to-end test cases of ViewModel which consist savedHandleState and few useCases and are injecting using Dependency injection No one have uploaded it till now and the rest videos are not much helpful...kindly create a seperate whole video on the above mentioned scenario🙏🙏🙏
@Heineken774
@Heineken774 Жыл бұрын
Source Code?
@CheezyCode
@CheezyCode Жыл бұрын
Sorry Igor...thoda delay hogaya....will commit all the source code soon
@Heineken774
@Heineken774 Жыл бұрын
@@CheezyCode Thanks I really appreciate it. This series of tests came at a perfect time
@rishikeshsingh9946
@rishikeshsingh9946 Жыл бұрын
Thank you so much Sir
@CheezyCode
@CheezyCode Жыл бұрын
Thank you bro
@Mohit-gb9dv
@Mohit-gb9dv Жыл бұрын
Bro can you please share your LinkedIn id
Spring Boot Testing Mini-Series Part #5: WebClient Tests
13:16
Code With Arho
Рет қаралды 15 М.
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН
Test your APIs in Android using MockWebServer!
12:03
Charfaoui Younes
Рет қаралды 1,6 М.
Senior Android Developer Checklist
19:53
Oday
Рет қаралды 12 М.
Android Mock Server with UI Testing - Tutorial
11:29
Memory Leak
Рет қаралды 2 М.
Android Testing ViewModel - Common problems
11:30
Renaro Santos
Рет қаралды 7 М.
Hilt testing best practices - MAD Skills
10:29
Android Developers
Рет қаралды 20 М.
How to Use the Google's New Screenshot Testing Framework for Compose
14:05
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН