-
Andy Wilkinson authored
Previously, when spying on a scoped bean the creation of the spy would be performed using the scoped proxy. This would result in the spy being unable to spy on any of the target bean's methods as the scoped proxy's implementations of those methods would be final. This commit updates MockitoPostProcessor so that the creation of the spy and injection of the @SpyBean-annotated field is performed using the scoped target. The scoped target has not be proxied so this allows Mockito to spy on all of its methods. Closes gh-17817
52050c17