Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Mockito is supported out-of-the-box #228

Closed
lazar-mitrovic opened this issue Apr 21, 2022 · 0 comments · Fixed by #236
Closed

Ensure Mockito is supported out-of-the-box #228

lazar-mitrovic opened this issue Apr 21, 2022 · 0 comments · Fixed by #236
Labels
enhancement New feature or request

Comments

@lazar-mitrovic
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
With Mockito 4.5.0 and ByteBuddy 1.12.9 releases it should now be possible to build tests that are using Mockito mocks - albeit with a few configuration options required.

Describe the solution you'd like
We should make sure that user doesn't need to configure anything on his part - If we detect that Byte Buddy is present we should make sure that required build arguments are automatically added.
Optionally we might want to notify user that only ByteBuddy >= 1.12.9 and Mockito >= 4.5.0 are supported

Describe alternatives you've considered
User can add the following to plugin configuration:

<buildArgs>
    <arg>--rerun-class-initialization-at-runtime=net.bytebuddy.ClassFileVersion,net.bytebuddy.utility.dispatcher.JavaDispatcher,net.bytebuddy.utility.Invoker$Dispatcher</arg>
    <arg>--initialize-at-build-time=net.bytebuddy.description.method.MethodDescription$InDefinedShape$AbstractBase$ForLoadedExecutable,net.bytebuddy.description.type.TypeDescription$AbstractBase,net.bytebuddy.description.type.TypeDescription$ForLoadedType,net.bytebuddy.description.method.MethodDescription$ForLoadedMethod,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic$1,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic$2,net.bytebuddy.implementation.bind.annotation.Super$Instantiation$2 </arg>
</buildArgs>

Additional context
Build arguments that should be added:

--rerun-class-initialization-at-runtime=\
net.bytebuddy.ClassFileVersion,\
net.bytebuddy.utility.dispatcher.JavaDispatcher,\
net.bytebuddy.utility.Invoker\$Dispatcher \
--initialize-at-build-time=\
net.bytebuddy.description.method.MethodDescription\$InDefinedShape\$AbstractBase\$ForLoadedExecutable,\
net.bytebuddy.description.type.TypeDescription\$AbstractBase,\
net.bytebuddy.description.type.TypeDescription\$ForLoadedType,\
net.bytebuddy.description.method.MethodDescription\$ForLoadedMethod,\
net.bytebuddy.implementation.bind.annotation.Argument\$BindingMechanic,\
net.bytebuddy.implementation.bind.annotation.Argument\$BindingMechanic\$1,\
net.bytebuddy.implementation.bind.annotation.Argument\$BindingMechanic\$2,\
net.bytebuddy.implementation.bind.annotation.Super\$Instantiation\$2
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant