Skip to content

Commit 23aff50

Browse files
committed
Add Mockito as agent for Java 21+
1 parent 178dbe7 commit 23aff50

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

pom.xml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<build.helper.maven-plugin.version>3.6.0</build.helper.maven-plugin.version>
8383
<maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
8484
<maven.surefire.plugin.version>3.5.0</maven.surefire.plugin.version>
85+
<maven-dependency-plugin.version>3.8.0</maven-dependency-plugin.version>
8586
<maven.failsafe.plugin.version>3.5.0</maven.failsafe.plugin.version>
8687
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
8788
<maven.jar.plugin.version>3.4.2</maven.jar.plugin.version>
@@ -170,16 +171,6 @@
170171
</properties>
171172
</profile>
172173

173-
<profile>
174-
<id>jvm-test-arguments-java-21-and-more</id>
175-
<activation>
176-
<jdk>[21,)</jdk>
177-
</activation>
178-
<properties>
179-
<test-arguments>-XX:+EnableDynamicAgentLoading</test-arguments>
180-
</properties>
181-
</profile>
182-
183174
<profile>
184175
<!--
185176
Java 8's Javadoc is way more sensible to documentation
@@ -536,6 +527,24 @@
536527
<mockito.version>4.11.0</mockito.version>
537528
</properties>
538529
</profile>
530+
<profile>
531+
<id>jvm-test-arguments-below-java-21</id>
532+
<activation>
533+
<jdk>[11,21)</jdk>
534+
</activation>
535+
<properties>
536+
<test-arguments>-Xshare:off</test-arguments>
537+
</properties>
538+
</profile>
539+
<profile>
540+
<id>jvm-test-arguments-java-21-and-more</id>
541+
<activation>
542+
<jdk>[21,)</jdk>
543+
</activation>
544+
<properties>
545+
<test-arguments>-Xshare:off -javaagent:${org.mockito:mockito-core:jar}</test-arguments>
546+
</properties>
547+
</profile>
539548

540549
</profiles>
541550

@@ -710,6 +719,18 @@
710719
</nonFilteredFileExtensions>
711720
</configuration>
712721
</plugin>
722+
<plugin>
723+
<groupId>org.apache.maven.plugins</groupId>
724+
<artifactId>maven-dependency-plugin</artifactId>
725+
<version>${maven-dependency-plugin.version}</version>
726+
<executions>
727+
<execution>
728+
<goals>
729+
<goal>properties</goal>
730+
</goals>
731+
</execution>
732+
</executions>
733+
</plugin>
713734
<plugin>
714735
<groupId>org.codehaus.gmaven</groupId>
715736
<artifactId>groovy-maven-plugin</artifactId>

src/test/java/com/rabbitmq/client/test/ConnectionTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.assertj.core.api.Assertions;
2121
import org.junit.jupiter.api.AfterEach;
2222
import org.junit.jupiter.api.BeforeEach;
23-
import org.junit.jupiter.api.Test;
2423
import org.junit.jupiter.params.ParameterizedTest;
2524
import org.junit.jupiter.params.provider.MethodSource;
2625
import org.mockito.Mock;

0 commit comments

Comments
 (0)