What is the difference between the @SpyBean and @MockBean annotations in Spring?
I have already gone through the JavaDoc but didn't get the difference. If possible please give an example when to use MockBean and when SpyBean.
What is the difference between the @SpyBean and @MockBean annotations in Spring?
I have already gone through the JavaDoc but didn't get the difference. If possible please give an example when to use MockBean and when SpyBean.
really important to note that the two annotations you are referencing come from Spring Boot, not Mockito (even though that spring lib theyre from is based on Mockito)
mixing test frameworks can give confusing and inaccurate results.