spring-framework/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring
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
..
annotation-activeprofiles.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-aftertransaction.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-beforetransaction.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-bootstrapwith.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-commit.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-contextconfiguration.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-contextcustomizerfactories.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-contexthierarchy.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-dirtiescontext.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-disabledinaotmode.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-dynamicpropertysource.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-mockitobean.adoc Bean overriding by type uses isAutowireCandidate for matching 2024-05-21 14:06:52 +02:00
annotation-recordapplicationevents.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-rollback.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-sql.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-sqlconfig.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-sqlgroup.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-sqlmergemode.adoc Fix migration to asciidoctor tabs 2023-05-09 12:15:43 +01:00
annotation-testbean.adoc Bean overriding by type uses isAutowireCandidate for matching 2024-05-21 14:06:52 +02:00
annotation-testexecutionlisteners.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-testpropertysource.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-webappconfiguration.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00