spring-framework/framework-docs/modules/ROOT/pages/testing
Sam Brannen 81d89f478a Relax singleton enforcement for Bean Overrides in the TestContext framework
In gh-33602, we introduced strict singleton enforcement for bean
overrides -- for example, for @⁠MockitoBean, @⁠TestBean, etc. However,
the use of BeanFactory#isSingleton(beanName) can result in a
BeanCreationException for certain beans, such as a Spring Data JPA
FactoryBean for a JpaRepository.

In light of that, this commit relaxes the singleton enforcement in
BeanOverrideBeanFactoryPostProcessor by only checking the result of
BeanDefinition#isSingleton() for existing bean definitions.

This commit also updates the Javadoc and reference documentation to
reflect the status quo.

See gh-33602
Closes gh-33800
2024-10-28 12:45:05 +01:00
..
annotations Relax singleton enforcement for Bean Overrides in the TestContext framework 2024-10-28 12:45:05 +01:00
mockmvc Rework links to Spring Boot in reference docs 2024-10-23 16:10:37 +02:00
testcontext-framework Relax singleton enforcement for Bean Overrides in the TestContext framework 2024-10-28 12:45:05 +01:00
annotations.adoc Remove duplicated section links for test annotations 2023-09-13 17:50:12 +02:00
appendix.adoc Trim IDs with parent 2023-05-04 15:35:05 +01:00
integration.adoc Document AssertJ support for MockMvc 2024-06-21 12:51:35 +02:00
introduction.adoc Enable Section Summary TOC for small pages 2023-05-04 15:35:05 +01:00
mockmvc.adoc Revise introductory content for MockMvc 2024-09-08 17:59:15 +02:00
resources.adoc Restructure content in testing resources section 2024-09-12 13:37:58 +02:00
spring-mvc-test-client.adoc Replace 'e.g.' with 'for example' in documentation and comments 2024-09-26 14:11:17 +02:00
support-jdbc.adoc Fix link in testing/support-jdbc.adoc 2024-10-14 12:07:17 +02:00
testcontext-framework.adoc Enable Section Summary TOC for small pages 2023-05-04 15:35:05 +01:00
unit.adoc Delete obsolete documentation for JNDI mock support 2024-07-01 18:32:28 +02:00
webtestclient.adoc Replace 'e.g.' with 'for example' in documentation and comments 2024-09-26 14:11:17 +02:00