Tuesday, January 31, 2023
How to Create Auto Incremented Identity Column in SQL Server, MySQL, and Oracle? Example
Top 10 Oracle Interview Question and Answer - Database and SQL
Thursday, January 26, 2023
Difference between SubStr vs SubString function in JavaScript - Tutorial Example
Monday, January 23, 2023
What is a Functional interface in Java 8? @FunctionalInterface Annotation Examples Tutorial
Friday, January 20, 2023
Strategy Design Pattern in Java using Enum - Tutorial Example
Wednesday, December 7, 2022
Is Java Pass by Value or Pass by Reference? Example
Wednesday, September 21, 2022
Difference between CAST, CONVERT, and PARSE SQL Server? Example Tutorial
Tuesday, August 30, 2022
Difference between @Mock and @MockBean in Spring Boot? Example Tutorial
Hello guys, if you are writing test for your your Spring Boot application then Sooner or later, you'll come across @Mock and @MockBean annotations while testing your Spring Boot application. Both annotations generate fake or Mock objects, but for different reasons and its important for Java and Spring Boot developer to know the correct difference and when to use @Mock and @MockBean while writing tests. It's possible that this will seem perplexing at first, in face I was confused for a long time until I did my research and cleared it up. But, you don't need to scan through internet, In this blog article, I'll clear up any misunderstandings and clarify the difference between @Mock and @MockBean when testing Spring Boot apps.