mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
374c3b4545
Prior to this commit, the Test Bean Override feature provided support for overriding beans based on qualifier annotations in several scenarios; however, qualifier annotations got lost if they were declared on the return type of the @Bean method for the bean being overridden and the @BeanOverride (such as @MockitoBean) was based on a supertype of that return type. To address that, this commit sets the @BeanOverride field as the "qualified element" in the RootBeanDefinition to ensure that qualifier annotations are available for subsequent autowiring candidate resolution. Closes gh-34646