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 |
||
|---|---|---|
| .. | ||
| ctx-management | ||
| aot.adoc | ||
| application-events.adoc | ||
| bean-overriding.adoc | ||
| bootstrapping.adoc | ||
| ctx-management.adoc | ||
| executing-sql.adoc | ||
| fixture-di.adoc | ||
| key-abstractions.adoc | ||
| parallel-test-execution.adoc | ||
| support-classes.adoc | ||
| tel-config.adoc | ||
| test-execution-events.adoc | ||
| tx.adoc | ||
| web-scoped-beans.adoc | ||