Skip to content

Commit 792c4f4

Browse files
committed
Merge branch '2.3.x'
Closes gh-22759
2 parents 1864f47 + c121f9f commit 792c4f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6680,6 +6680,9 @@ NOTE: While Spring's test framework caches application contexts between tests an
66806680
TIP: If you are using `@SpyBean` to spy on a bean with `@Cacheable` methods that refer to parameters by name, your application must be compiled with `-parameters`.
66816681
This ensures that the parameter names are available to the caching infrastructure once the bean has been spied upon.
66826682

6683+
TIP: When you are using `@SpyBean` to spy on a bean that is proxied by Spring, you may need to remove Spring's proxy in some situations, for example when setting expectations using `given` or `when`.
6684+
Use `AopTestUtils.getTargetProxy(yourProxiedSpy)` to do so.
6685+
66836686

66846687

66856688
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-tests]]

0 commit comments

Comments
 (0)