-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Document @MockBean vs @MockitoBean migration compatibility #43348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't recall such a discussion. FWIW, I believe that the reference documentation is the wrong place for this as it is related to upgrade considerations. Before we get going, we would need to see what if, if any, will be implemented in Spring Framework. |
@MockBean
vs. @MockitoBean
compatibility in reference docs
I agree with @snicoll, we generally keep this kind of thing out of the reference docs. However, we could either improve our release notes or add another "migrating" page to the wiki. |
Putting on hold for a little while because we'd like to know how spring-projects/spring-framework#33925 will play out. |
spring-projects/spring-framework#33925 has now been fixed. |
Overview
Due to the deprecation of
@MockBean
and@SpyBean
in favor of Spring Framework's new@MockitoBean
and@MockitoSpyBean
support, several users have raised issues in the Spring Framework issue tracker regarding incompatibilities between the two sets of annotations.Although incompatibilities are to be expected, it is not immediately clear to users what the differences are.
To address that, the Framework team proposes that the Boot team introduce a new section in the Mocking and Spying Beans section of the reference docs that lists known differences and potential migration strategies.
This could perhaps be addressed via a "compatibility matrix" for the 4 annotations.
Since the deprecation of
@MockBean
and@SpyBean
and the migration to@MockitoBean
and@MockitoSpyBean
are specific to Boot, the Framework team feels the migration/compatibility documentation would best reside in Boot's reference docs.Ideally, members of the Boot and Framework teams could collaborate on compiling the compatibility matrix, and I'd be happy to assist with that.
Related Issues
@MockitoBean
at the type level on test classes spring-framework#33925@MockitoBean
in@Configuration
classes spring-framework#33934@MockitoSpyBean
requires existing bean instance to spy on spring-framework#33935The text was updated successfully, but these errors were encountered: