maven icon indicating copy to clipboard operation
maven copied to clipboard

Add Mockito as an agent

Open Bukama opened this issue 1 month ago • 1 comments

New feature, improvement proposal

When running mvnup/ApplicabilityTests tests, there is a warning of Mockito that it should be added as an agent.

Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3 WARNING: A Java agent has been loaded dynamically (C:\Users\matth.m2\repository\net\bytebuddy\byte-buddy-agent\1.17.7\byte-buddy-agent-1.17.7.jar) WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information WARNING: Dynamic loading of agents will be disallowed by default in a future release OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Bukama avatar Nov 16 '25 17:11 Bukama

Hi, I would like to work on this issue.

I have reviewed the Mockito agent-loading warning and understand that future JDK versions will restrict dynamic attachment. My plan is to reproduce the warning, update the test execution configuration to add the Mockito/ByteBuddy agent via -javaagent, verify the fix, and submit a focused PR.

Please let me know if there are any additional guidelines before I proceed.

Thank you!

kri-jha avatar Dec 02 '25 05:12 kri-jha