Skip to content

Recognize relocated Mockito MockAccess interface in ProxyProcessorSupport #37342

Description

@maartenc

ProxyProcessorSupport.isInternalLanguageInterface recognises Mockito's MockAccess interface by checking whether its name ends with .bytebuddy.MockAccess, so that evaluateProxyInterfaces doesn't treat it as a proxy interface.

Since Mockito 5.16.1 (mockito/mockito#3608), this interface has moved to org.mockito.internal.creation.bytebuddy.access.MockAccess, so the check no longer matches. As a result, an auto-proxied mock created with the subclass mock maker (with proxyTargetClass=false) gets a JDK proxy that only implements MockAccess instead of a CGLIB proxy, so the bean is no longer of its own class.

Could .bytebuddy.access.MockAccess be added to the check in ProxyProcessorSupport as well?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions