Skip to content

Commit c121f9f

Browse files
committed
Merge branch '2.2.x' into 2.3.x
Closes gh-22758
2 parents 235f5e1 + b53f54f commit c121f9f

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
@@ -6590,6 +6590,9 @@ NOTE: While Spring's test framework caches application contexts between tests an
65906590
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`.
65916591
This ensures that the parameter names are available to the caching infrastructure once the bean has been spied upon.
65926592

6593+
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`.
6594+
Use `AopTestUtils.getTargetProxy(yourProxiedSpy)` to do so.
6595+
65936596

65946597

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

0 commit comments

Comments
 (0)