Overview

Initial documentation for bean override support in the Spring TestContext Framework (TCF) was introduced in e1bbdf09139dca7c21ec64e140bcc3bda463b2f6; however, that documentation resides in the appendix for the testing chapter.

The goal of this issue is therefore to introduce a dedicated subsection (in the TCF section) which documents the "Bean Override" support as a first-class feature. That section should cross-reference the @TestBean, @MockitoBean, and @MockitoSpyBean sections in the appendix.

Related Issues

  • 29917

Comment From: snicoll

The new dedicated section should also clearly point out the difference between the TCF support for bean overrides and Spring Boot's @MockBean/@SpyBean support

I disagree, it should not do that. New users of the feature will see the feature as documented. Existing Spring Boot users will have to follow the migration guide that Spring Boot will put in place to help users migrate. The Spring Boot feature will be deprecated and eventually removed so it does not make sense to document it here IMO.

Comment From: sbrannen

Good points, @snicoll.

Let's omit the comparison with Spring Boot's mocking support.

I'll remove that paragraph from this issue's description.