spring-framework/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring
Sam Brannen 1c87e4795d Introduce enforceOverride flag in @⁠TestBean and @⁠MockitoBean
Prior to this commit, @⁠MockitoBean could be used to either create or
replace a bean definition, but @⁠TestBean could only be used to replace
a bean definition.

However, Bean Override implementations should require the presence of
an existing bean definition by default (i.e. literally "override" by
default), while giving the user the option to have a new bean
definition created if desired.

To address that, this commit introduces a new `enforceOverride`
attribute in @⁠TestBean and @⁠MockitoBean that defaults to true but
allows the user to decide if it's OK to create a bean for a nonexistent
bean definition.

Closes gh-33613
2024-09-30 14:32:53 +02:00
..
annotation-activeprofiles.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-aftertransaction.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-beforetransaction.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-bootstrapwith.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-commit.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-contextconfiguration.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-contextcustomizerfactories.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-contexthierarchy.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-dirtiescontext.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-disabledinaotmode.adoc Clarify supported targets for annotations in the TestContext framework 2024-05-07 16:45:12 +03:00
annotation-dynamicpropertysource.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-mockitobean.adoc Introduce enforceOverride flag in @⁠TestBean and @⁠MockitoBean 2024-09-30 14:32:53 +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 Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-sql.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-sqlconfig.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-sqlgroup.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-sqlmergemode.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-testbean.adoc Introduce enforceOverride flag in @⁠TestBean and @⁠MockitoBean 2024-09-30 14:32:53 +02:00
annotation-testexecutionlisteners.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-testpropertysource.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00
annotation-webappconfiguration.adoc Remove obsolete role attributes for tab groups in the reference manual 2024-09-08 17:20:10 +02:00