Skip to content

Commit

Permalink
Allow tests to run on Java 21, but retain Java 8 compat
Browse files Browse the repository at this point in the history
Bump dependencies:
JUnit to 5.10.1
AssertJ to 5.24.2
Mockito to 5.7.0 (Java 11+) or to 4.11.0 (Java 8)
  • Loading branch information
mrotteveel committed Nov 23, 2023
1 parent 8409efe commit c828c2d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ java {
}

ext {
junit_jupiter = '5.9.2'
junit_jupiter = '5.10.1'
hamcrest = '2.2'
assertj = '3.23.1'
mockito = '4.10.0'
assertj = '3.24.2'
// Mockito 5 requires Java 11 or higher
mockito = findProperty('buildProfile') == 'java8' ? '4.11.0' : '5.7.0'
}

dependencies {
Expand All @@ -87,7 +88,9 @@ dependencies {
testImplementation "org.assertj:assertj-core:$assertj"

testImplementation "org.mockito:mockito-core:$mockito"
testImplementation "org.mockito:mockito-inline:$mockito"
if (findProperty('buildProfile') == 'java8') {
testImplementation "org.mockito:mockito-inline:$mockito"
}
testImplementation "org.mockito:mockito-junit-jupiter:$mockito"
}

Expand Down

0 comments on commit c828c2d

Please sign in to comment.