Skip to content

Commit

Permalink
Fix Java 21 tests by placing mockito before assertj
Browse files Browse the repository at this point in the history
https://groups.google.com/g/byte-buddy/c/H3auRC-SRts/m/7NCRN2wAAwAJ
notes that the version of bytebuddy in assertj does not support Java 21
while the version of bytebuddy in mockito supports Java 21.  Load mockito
first so that the newer version of bytebuddy is used for the tests.

This change is necessary but not sufficient to pass the tests on Java 21.
The tests run much better on Java 21 with this change, but there are still
two tests that fail.  They will need to be investigated and resolved in
a separate pull request.
  • Loading branch information
MarkEWaite committed Oct 14, 2023
1 parent bd64ae4 commit d05ffaf
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@
<artifactId>pipeline-rest-api</artifactId>
</dependency>

<!-- mockito must precede assertj until assertj supports Java 21 -->
<!-- mockito provides a Java 21 capable version of bytebuddy -->
<!-- TODO: restore ordering once assertj supports Java 21 -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<!-- assertj must follow mockito until assertj supports Java 21 -->
<!-- assertj does not provide a Java 21 capable version of bytebuddy -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand All @@ -152,18 +162,6 @@
<version>${JUnitParams.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.mockito</groupId>-->
<!-- <artifactId>mockito-inline</artifactId>-->
<!-- <version>${mockito.version}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-lambda</artifactId>
Expand Down

0 comments on commit d05ffaf

Please sign in to comment.