Skip to content

Conversation

@GuusLieben
Copy link
Member

Type of Change

  • Chore (changes to the build process or auxiliary tools)

Description

For a while now we've received the warning below regarding Mockito dynamically attaching its 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 (/Users/guuslieben/.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

With the recent upgrade to Java 25, we're long overdue to address this warning properly. As such, this PR explicitly sets up the Mockito agent.

Checklist

  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have rebased my branch on top of the latest develop branch

@GuusLieben GuusLieben added this to the 0.7.0 milestone Dec 29, 2025
@GuusLieben GuusLieben self-assigned this Dec 29, 2025
@GuusLieben GuusLieben merged commit c6481b2 into develop/0.7.0 Dec 29, 2025
9 checks passed
@GuusLieben GuusLieben deleted the chore/mockito-agent branch December 29, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants