mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
9107f7b592
Prior to this commit, test bean overrides (for example, @MockitoBean, @TestBean, etc.) eagerly honored the name of the annotated field as a fallback qualifier, effectively ignoring @Primary and @Fallback semantics for certain use cases. This led to situations where a bean override for a test would select a different bean than the core container would for the same autowiring metadata. To address that, this commit revises the implementation of BeanOverrideBeanFactoryPostProcessor so that @Primary and @Fallback semantics are consistently honored before attempting to use the annotated field's name as a fallback qualifier. Closes gh-34374