Warn users about the caching implications of @MockBean and @SpyBean

Closes gh-10182
This commit is contained in:
Stephane Nicoll 2018-02-08 15:02:46 +01:00
parent 4beb6be179
commit 0f6a13c9b3
1 changed files with 3 additions and 0 deletions

View File

@ -6148,6 +6148,9 @@ implementation:
Additionally, you can use `@SpyBean` to wrap any existing bean with a Mockito `spy`. See
the {dc-spring-boot-test}/mock/mockito/SpyBean.{dc-ext}[Javadoc] for full details.
NOTE: While Spring's test framework caches application contexts between tests and reuses
a context for tests sharing the same configuration, the use of `@MockBean` or `@SpyBean`
influences the cache key, which will most likely increase the number of contexts.
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-tests]]
==== Auto-configured Tests