Skip to content

Test Bean Overrides do not honor @Primary semantics #33819

@sbrannen

Description

@sbrannen

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

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions