Skip to content

Commit 65cf01e

Browse files
fix(test): configure mockito as javaagent to suppress self-attach warning (kroxylicious#3579)
Add -javaagent arg for mockito-core to both maven-surefire-plugin and maven-failsafe-plugin in the parent POM. This ensures Mockito is loaded as a proper Java agent rather than self-attaching at runtime, which eliminates the deprecation warning and prepares for future JDK versions that will disallow dynamic agent loading. Fixes kroxylicious#3576 Signed-off-by: Tanner Smith <griffonbyte@proton.me> Co-authored-by: Sam Barker <sam@quadrocket.co.uk>
1 parent c3860ee commit 65cf01e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,9 @@
742742
<io.netty.leakDetection.level>paranoid</io.netty.leakDetection.level>
743743
<container.logs.dir>${project.build.directory}/container-logs/</container.logs.dir>
744744
</systemPropertyVariables>
745+
<argLine>
746+
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
747+
</argLine>
745748
<runOrder>random</runOrder>
746749
</configuration>
747750
<executions>
@@ -800,6 +803,7 @@
800803
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
801804
</statelessTestsetReporter>
802805
<argLine>
806+
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
803807
-Dio.netty.allocator.type=pooled
804808
@{jacoco.argline}
805809
</argLine>

0 commit comments

Comments
 (0)