Skip to content

Commit

Permalink
Document need for -parameters compilation with @SpyBean and @Cacheable
Browse files Browse the repository at this point in the history
Closes gh-13945
  • Loading branch information
wilkinsona committed Oct 8, 2018
1 parent 4f51a83 commit 9afd6f5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6392,6 +6392,11 @@ NOTE: While Spring's test framework caches application contexts between tests an
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.

TIP: If you are using `@SpyBean` to spy on a bean with `@Cachable` methods that refer
to parameter's by name, your application must be compiled with `-parameters`. This
ensures that the parameter names are available to the caching infrastructure once the
bean has been spied upon.



[[boot-features-testing-spring-boot-applications-testing-autoconfigured-tests]]
Expand Down

0 comments on commit 9afd6f5

Please sign in to comment.