spring-framework/framework-docs
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
..
modules/ROOT Relax singleton enforcement for Bean Overrides in the TestContext framework 2024-10-28 12:45:05 +01:00
src Document UrlHandler Servlet and reactive filters 2024-10-24 16:14:18 +02:00
antora-playbook.yml Update Antora Spring UI to v0.4.17 2024-10-16 14:15:55 +02:00
antora.yml Rework links to Spring Boot in reference docs 2024-10-23 16:10:37 +02:00
framework-docs.gradle Merge branch '6.1.x' 2024-07-26 10:05:06 +02:00
package.json Improve the discoverability of Java and Kotlin APIs 2024-10-22 08:40:28 +02:00