spring-framework/framework-docs/modules/ROOT/pages/testing/annotations
Simon Baslé d5c7a5e2db Bean overriding by type uses isAutowireCandidate for matching
This commit uses the bean factory `isAutowiredCandidate` method directly
in `BeanOverrideBeanFactoryPostProcessor` to select a single match among
multiple candidates when matching by type.

The expected consequence, in most cases, is that this will delegate to
a `@Qualifier`-aware `QualifierAnnotationAutowireCandidateResolver`.
In that sense, bean overriding by-type matching is now potentially
taking Qualifier annotations or meta-annotations into account.

It also changes the way existing bean definitions are checked in case
a bean name has been specified: factory beans are now taken into account
when checking the type of an existing definition matches the expected
bean override type.

Closes gh-32822
2024-05-21 14:06:52 +02:00
..
integration-spring Bean overriding by type uses isAutowireCandidate for matching 2024-05-21 14:06:52 +02:00
integration-junit-jupiter.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
integration-junit4.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
integration-meta.adoc Extract recurring asciidoc links to attributes, cleanup old doc files 2023-11-21 15:59:24 +01:00
integration-spring.adoc Polish "Bean Overriding in Tests" support 2024-04-16 17:08:15 +02:00
integration-standard.adoc Fix cross references 2023-05-04 15:35:05 +01:00