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 |
||
---|---|---|
.. | ||
annotations | ||
mockmvc | ||
testcontext-framework | ||
annotations.adoc | ||
appendix.adoc | ||
integration.adoc | ||
introduction.adoc | ||
mockmvc.adoc | ||
resources.adoc | ||
spring-mvc-test-client.adoc | ||
support-jdbc.adoc | ||
testcontext-framework.adoc | ||
unit.adoc | ||
webtestclient.adoc |