Skip to content
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

Test Bean Overrides do not honor @Primary semantics #33819

Closed
sbrannen opened this issue Oct 30, 2024 · 0 comments
Closed

Test Bean Overrides do not honor @Primary semantics #33819

sbrannen opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
in: test Issues in the test module type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

Overview

Spring Boot has honored @Primary for @MockBean and @SpyBean since Spring Boot 1.4.3; however, the support for @Primary was lost when the @MockBean/@SpyBean support was ported from Spring Boot to Spring Framework's new Bean Overrides feature in the TestContext framework.

Since the lack of this support constitutes a regression for anyone migrating from @MockBean/@SpyBean to @MockitoBean/@MockitoSpyBean, I have labeled this issue as a "bug".

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant