Closed
Description
Overview
SpringAopBypassingVerificationStartedListener
provides partial support for transparent verification for Mockito spies created via @MockitoSpyBean
when the spy is wrapped in a Spring AOP proxy.
However, the following @Disabled
test currently fails since the AOP proxy for the DateService
is not considered a mock by Mockito.
To provide transparent verification support for @MockitoSpyBean
, we need to implement and register a Mockito MockResolver
, analogous to the SpringBootMockResolver
in Spring Boot.
Related Issues
- AopTestUtils.getUltimateTargetObject results in stack overflow for proxy backed by LazyInitTargetSource #29215 (comment)
- SpringBootMockResolver causes AopTestUtils.getUltimateTargetObject to recurse until the stack overflows when it calls it with Spring Security's authentication manager bean spring-boot#32632
- Allow proxied @SpyBeans to be used with Mockito's inline mock maker spring-boot#22416
- mockito3.4.0 InlineByteBuddyMockMaker can't work with spring cglib proxy, but ByteBuddyMockMaker works mockito/mockito#1980