Тёмный
No video :(

Mockito Junit Interview Question and Answer for fresher and experienced with example | Code Decode 

Code Decode
Подписаться 135 тыс.
Просмотров 30 тыс.
50% 1

In this video of code decode we have explained mockito interview questions and answers
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
What is Mockito in JUnit?
Mockito is a Java-based mocking framework used for unit testing of Java application. Its used in conjunction with other testing frameworks such as JUnit and TestNG. It internally uses Java Reflection API in order to create mock objects for a given interface. Mock objects are nothing but proxy for actual implementations.
What is Mocking?
Mocking in mockito is a process of developing the objects that act as the mock or clone of the real objects. In other words, mocking is a testing technique where mock objects are used instead of real objects for testing purposes. Mock objects provide a specific (dummy) output for a particular (dummy) input passed to it.
Mocking in mockito is used for unit testing is when you create an object that implements the behavior of a real subsystem in controlled ways. In short, mocks are used as a replacement for a dependency.
To mock objects, you need to understand these key concepts of mocking, i.e., stub, fake, spy, dummy and mock. Some of the unit tests involve only stubs, whereas some involve fake, and mocks.
A method invoked using mocked reference does not execute the actual method body defined in the class file, rather the method behavior is configured using when(...).thenReturn(...) methods.
What is @Mock and @InjectMocks?
In mockito-based junit tests, @Mock annotation creates mocks and @InjectMocks creates actual objects and injects mocked dependencies into it.
We must define the when(...).thenReturn(...) methods for mock objects whose class methods will be invoked during actual test execution.
So In a junit test, we create objects for the class which need to be tested and its methods to be invoked using inject mock
We create mocks for the dependencies which will not be present in the test environment and objects are dependent on it to complete the method call.
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
SQL Playlist : • SQL Interview Question...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#mockito #codedecode #junit #javainterviewquestion

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 96   
@bluesibilings2806
@bluesibilings2806 Год назад
No words to describe for your explanation, became huge fan of you!!!!!🥰. Please create a series for other Junit topics also like spy, fake and dummy etc..
@tabishrizwan9137
@tabishrizwan9137 Месяц назад
I struggled to understand junit with mockito. you made me understand in very simple & easy way.
@235gurukeerthana5
@235gurukeerthana5 2 месяца назад
i learned some many things because of your explanation huge fan of you!!!!!. Please create a series for other Junit topics also like spy, fake and dummy etc.. and please create updated technologys full of topics for interviews
@BaluKompalli
@BaluKompalli 2 года назад
Great tutorial. I have followed each and every video and have practiced the same flow. Got successful response.
@mdshahnawaz5949
@mdshahnawaz5949 2 года назад
It is awsome how you are helping us. Please do release the next part soon ie writing Junit for controller.
@CodeDecode
@CodeDecode 2 года назад
Sure Shahnawaz 👍🙂
@manognajoshik8465
@manognajoshik8465 Год назад
Wonderful!! I am a regular follower of your tutorials. Can you please cover everything related to junit and mockito for all layers?
@CodeDecode
@CodeDecode Год назад
Sure Manogna 🙂🙂
@Hosthubs
@Hosthubs 2 года назад
Thanks for hearing my request so sooner than later.. I appreciate it,,😊😊
@CodeDecode
@CodeDecode 2 года назад
Thanks for suggesting Mockito. 👍👍nice suggestion Man 👍👍
@dileephl2709
@dileephl2709 Год назад
Your explanation is very good, please do cover the remaining things also. We will support you!!
@CodeDecode
@CodeDecode Год назад
Thanks 🙏👍 sure 😊
@kalavalaharipriya6407
@kalavalaharipriya6407 Год назад
Nice and good understanding tutorial, please help to cover all the concepts related to JUnit testing
@CodeDecode
@CodeDecode Год назад
Sure we will upload soon 👍👍🙂
@abusufiyanrafey4555
@abusufiyanrafey4555 Год назад
very helpful..🙂👍Please come soon with other parts..Thanks!!!
@CodeDecode
@CodeDecode Год назад
Thanks sure 👍👍🙂🙂
@rashmipatil9380
@rashmipatil9380 Месяц назад
Very well explained. Had good learning. Please create the next video.
@ankitshah4211
@ankitshah4211 2 года назад
Marvellous work you are doing...waiting for next videos eagerly
@CodeDecode
@CodeDecode 2 года назад
Thanks Ankit 🙂👍
@anandnerurkar2572
@anandnerurkar2572 10 месяцев назад
good one and nice explainaion, pls add for fake ,spy,dummy also
@CodeDecode
@CodeDecode 10 месяцев назад
Sure we will create video on it soon
@shrutik1863
@shrutik1863 Год назад
Waiting for next video in series, thanks a lot💐
@CodeDecode
@CodeDecode Год назад
sure Shruti we will upload it soon
@sanketh768
@sanketh768 Год назад
Please make a detailed video on other annotations like spy mock, mockbean and other annotations as well.
@CodeDecode
@CodeDecode Год назад
Sure 🙂🙂
@sanketh768
@sanketh768 Год назад
@@CodeDecode will be waiting for your video
@VVV-xf5vl
@VVV-xf5vl Год назад
Thanx, do the the rest please. It is a great list of tutorials
@CodeDecode
@CodeDecode Год назад
Thanks . Sure👍👍
@raakesh4652
@raakesh4652 2 года назад
These videos are very helpful.... pls cover the remaining topics....
@CodeDecode
@CodeDecode 2 года назад
sure we will cover it soon
@truthreveal6521
@truthreveal6521 Год назад
How to mock private methods . Plz continue these series
@CodeDecode
@CodeDecode Год назад
Sure 👍👍
@sufiyanKhan-wn9wq
@sufiyanKhan-wn9wq 4 месяца назад
PLEASE MAKE VIDEO ON Controller junit and remaning topics of mockito ....
@CodeDecode
@CodeDecode 3 месяца назад
Sure 👍
@RanjitKumar-kb7zt
@RanjitKumar-kb7zt Год назад
Great explanation. Please cover remaining as well from Junit :)
@CodeDecode
@CodeDecode Год назад
sure Ranjit we will create it soon
@RanjitKumar-kb7zt
@RanjitKumar-kb7zt Год назад
@@CodeDecode Thank you
@Hosthubs
@Hosthubs 2 года назад
please create next part. I will be waiting for it. thanks
@CodeDecode
@CodeDecode 2 года назад
Sure Bhavik 👍👍
@akashsaha9366
@akashsaha9366 2 года назад
Thanks, please make the next video on spy and mockito
@CodeDecode
@CodeDecode 2 года назад
Sure Akash 🙂👍
@pritesh427
@pritesh427 9 месяцев назад
Hi Maam, such a great explanation.!! Can you please upload the third video, covering the test cases for controller class?
@CodeDecode
@CodeDecode 9 месяцев назад
Sure 👍👍
@snehalakkar9842
@snehalakkar9842 Год назад
Very good tutorial, pls cover further part of this tutorial and spy
@CodeDecode
@CodeDecode Год назад
Sure we will cover it soon
@NIKHILKUMAR-it4nj
@NIKHILKUMAR-it4nj Год назад
like the way you are explaining mam , waiting for another junit on controller 🙏🙏
@CodeDecode
@CodeDecode Год назад
Sure Nikhil 👍👍
@rakeshburra7655
@rakeshburra7655 2 года назад
Thanks very neat explanation, Waiting for next video on Mockito
@CodeDecode
@CodeDecode 2 года назад
Sure we will create it soon
@hussainbasha8106
@hussainbasha8106 Год назад
Thanks for the great session on mockito junit could please cover the remaining parts like controller all those concepts.
@CodeDecode
@CodeDecode Год назад
Sure thing!👍👍
@swarnavakhara7501
@swarnavakhara7501 Год назад
Please make a video on junit controller class as well
@CodeDecode
@CodeDecode Год назад
Sure 👍👍
@shilpajagdeesh7156
@shilpajagdeesh7156 Год назад
very helpful. great understanding. Please cover all remaining Junit along with controller.
@oldaccount137
@oldaccount137 2 года назад
Very helpful mam please make furthur videos
@CodeDecode
@CodeDecode 2 года назад
Sure 😊👍
@AshutoshMohanty07
@AshutoshMohanty07 2 года назад
Thanks for hearing the request. 🙏🙏
@CodeDecode
@CodeDecode 2 года назад
You're welcome
@lakshmichepeni6903
@lakshmichepeni6903 Год назад
Thanks for the video.. could you please make complete video for Mockito including the topics mentioned at the ending of this video
@bharukeerthi1986
@bharukeerthi1986 Год назад
Great .. please cover remaining topics
@CodeDecode
@CodeDecode Год назад
sure we will cover it soon
@rakeshkachhadiya
@rakeshkachhadiya Год назад
Great work again.
@CodeDecode
@CodeDecode Год назад
Thanks Rakesh
@KateShubham
@KateShubham Год назад
This is quality stuff! Are next parts already there now?? can somebody provide link to next parts?
@utkarshshukla4505
@utkarshshukla4505 Год назад
Excellent video mam 👍 , mam can you please cover all
@CodeDecode
@CodeDecode Год назад
sure we will cover it soon
@ankitambekar6073
@ankitambekar6073 Год назад
Hi, please upload a next video of the mockito series.
@CodeDecode
@CodeDecode Год назад
Sure Ankit 👍
@swapnilmishra697
@swapnilmishra697 2 года назад
Thanks for this series
@CodeDecode
@CodeDecode 2 года назад
😊😊
@lakshmipriyaalagiyamanaval3059
Please create the subsequent part. We are waiting
@CodeDecode
@CodeDecode Год назад
Sure LakshmiPriya👍👍
@codingmoments
@codingmoments 2 года назад
Thnx for this video
@CodeDecode
@CodeDecode Год назад
you're welcome
@neha6000
@neha6000 2 года назад
Nice video
@CodeDecode
@CodeDecode 2 года назад
Thanks 😊😊
@virajpatel5859
@virajpatel5859 2 года назад
Nice.
@CodeDecode
@CodeDecode 2 года назад
😊Thanks
@kavithaeswaradoss8970
@kavithaeswaradoss8970 Год назад
Pl add a video on doreturn thenreturn controllerjunit tests do nothing etc
@kiranlulla6540
@kiranlulla6540 2 года назад
Thank you
@CodeDecode
@CodeDecode 2 года назад
Thanks Kiran 😊👍
@harshitsachdeva4836
@harshitsachdeva4836 Год назад
How to throw checked exception like IOEXception using thenThrow of mockito ?
@velankayalasrinu2190
@velankayalasrinu2190 Год назад
please do for the controller also
@CodeDecode
@CodeDecode Год назад
sure we will create it soon
@prathappoojary8585
@prathappoojary8585 Год назад
Do the video spy,, dothrows ..ect pls
@CodeDecode
@CodeDecode Год назад
Sure 👍👍
@ionadsouza1066
@ionadsouza1066 Год назад
Please make another video
@CodeDecode
@CodeDecode Год назад
Sure we will create it soon
@nareshk4880
@nareshk4880 2 года назад
please do video for rest controlloer junit with mockito
@rishiraj2548
@rishiraj2548 Год назад
👍👍
@satyanarayanareddyb3052
@satyanarayanareddyb3052 2 года назад
Please do the controller Junit..
@CodeDecode
@CodeDecode 2 года назад
Sure 👍👍
@sarannav365
@sarannav365 2 месяца назад
@@CodeDecode can u please provide the link for controller Junit?
@shubhamraj5184
@shubhamraj5184 Год назад
Where is Controller class Junit
@aakashyadav9117
@aakashyadav9117 Год назад
only 5 likes remaining for 500
@pavanpavankalyan2790
@pavanpavankalyan2790 Год назад
how can we write test case for printstacktrace in catch and Logger Messsages (log.isDebugEnabled)
Далее
Moto Trial vs Moto acrobática 🏁
00:29
Просмотров 2,3 млн
Friends
00:32
Просмотров 177 тыс.
Mocks, Stubs and Spies with Mockito - JUnit Tutorial
14:59
Interview Questions on Load Balancer - Hands On Example
42:12
Mockito Tutorial - Mocking With Junit and Maven
1:11:53
Просмотров 547 тыс.
Mockito JUnit Example
18:53
Просмотров 329 тыс.