Skip to content

Commit 876d00e

Browse files
committed
Upgrade Mockito to 5.18.0 and support building with JDK 24
Also hard-codes the mockito 4 version in the one place we use so dependabot will automatically upgrade Mockito 5.1.13. Closes gh-6517 Closes gh-6516
1 parent ae06551 commit 876d00e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ latency-utils = "2.0.3"
5555
logback-latest = "1.5.3"
5656
log4j = "2.23.1"
5757
maven-resolver = "1.9.24"
58-
mockito4 = "4.11.0"
59-
mockito5 = "5.11.0"
58+
mockito5 = "5.18.0"
6059
mongo = "4.11.5"
6160
netty = "4.1.122.Final"
6261
newrelic-api = "5.14.0"
@@ -172,7 +171,6 @@ log4j = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j"
172171
mavenResolverConnectorBasic = { module = "org.apache.maven.resolver:maven-resolver-connector-basic", version.ref = "maven-resolver" }
173172
mavenResolverTransportHttp = { module = "org.apache.maven.resolver:maven-resolver-transport-http", version.ref = "maven-resolver" }
174173
mavenResolverProvider = { module = "org.apache.maven:maven-resolver-provider", version = "3.9.10" }
175-
mockitoCore4 = { module = "org.mockito:mockito-core", version.ref = "mockito4" }
176174
mockitoCore5 = { module = "org.mockito:mockito-core", version.ref = "mockito5" }
177175
mongoSync = { module = "org.mongodb:mongodb-driver-sync", version.ref = "mongo" }
178176
nettyBom = { module = "io.netty:netty-bom", version.ref = "netty" }

micrometer-observation-test/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ dependencies {
66
api 'org.assertj:assertj-core'
77
api libs.junitJupiter
88

9-
implementation libs.mockitoCore4
9+
// hard-code mockito 4 version here due to dependabot limitation with multiple versions of same dependency
10+
// mockito 4 because we want to maintain compatibility with Java 8
11+
implementation('org.mockito:mockito-core:4.11.0')
1012

1113
testImplementation 'org.awaitility:awaitility'
1214
}

micrometer-osgi-test/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import aQute.bnd.gradle.Bundle
22
import aQute.bnd.gradle.Resolve
33
import aQute.bnd.gradle.TestOSGi
44

5+
// skip this module when building with jdk >=24
6+
// waiting for a release with the fix https://github.com/bndtools/bnd/pull/6371
7+
if (javaLanguageVersion.canCompileOrRun(24)) {
8+
project.tasks.configureEach { task -> task.enabled = false }
9+
}
10+
511
dependencies {
612
testImplementation 'org.assertj:assertj-core'
713
testImplementation libs.osgiJunit5

0 commit comments

Comments
 (0)