Skip to content

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

Open
sbrannen opened this issue Dec 2, 2024 · 4 comments
Open

Document @MockBean vs @MockitoBean migration compatibility #43348

sbrannen opened this issue Dec 2, 2024 · 4 comments
Labels
type: wiki-documentation A documentation update required on the wiki
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Dec 2, 2024

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2024
@snicoll snicoll added the for: team-meeting An issue we'd like to discuss as a team to make progress label Dec 2, 2024
@snicoll
Copy link
Member

snicoll commented Dec 2, 2024

the Framework team proposes that the Boot team introduce a new section in the Mocking and Spying Beans section of the reference docs

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.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed for: team-meeting An issue we'd like to discuss as a team to make progress labels Dec 2, 2024
@philwebb philwebb changed the title Document @MockBean vs. @MockitoBean compatibility in reference docs Document @MockBean vs @MockitoBean migration compatibility Dec 2, 2024
@philwebb philwebb added type: wiki-documentation A documentation update required on the wiki and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Dec 2, 2024
@philwebb philwebb added this to the 3.4.x milestone Dec 2, 2024
@philwebb
Copy link
Member

philwebb commented Dec 2, 2024

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.

@philwebb philwebb added the status: on-hold We can't start working on this issue yet label Dec 2, 2024
@philwebb
Copy link
Member

philwebb commented Dec 2, 2024

Putting on hold for a little while because we'd like to know how spring-projects/spring-framework#33925 will play out.

@philwebb
Copy link
Member

spring-projects/spring-framework#33925 has now been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: wiki-documentation A documentation update required on the wiki
Projects
None yet
Development

No branches or pull requests

4 participants