Skip to content

Commit 7cda7e0

Browse files
committed
Test on Java 21
* Add JDK 21 to Gradle configuration * Add JDK 21 to the test matrix * Replace JDK 17 with JDK 21 for tasks that are ony run using latest JDK * Update Mockito dependency JAVA-5164
1 parent d375cd4 commit 7cda7e0

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

.evergreen/.evg.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,10 @@ axes:
17641764
- id: jdk
17651765
display_name: JDK
17661766
values:
1767+
- id: "jdk21"
1768+
display_name: JDK21
1769+
variables:
1770+
JAVA_VERSION: "21"
17671771
- id: "jdk17"
17681772
display_name: JDK17
17691773
variables:
@@ -2012,7 +2016,8 @@ buildvariants:
20122016
- name: "test"
20132017

20142018
- matrix_name: "tests-jdk-secure"
2015-
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17" ], version: [ "3.6", "4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "latest" ],
2019+
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"],
2020+
version: [ "3.6", "4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "latest" ],
20162021
topology: "*", os: "linux" }
20172022
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
20182023
tags: ["tests-variant"]
@@ -2027,26 +2032,28 @@ buildvariants:
20272032
- name: "test"
20282033

20292034
- matrix_name: "tests-require-api-version"
2030-
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk17"], version: ["5.0", "6.0", "7.0", "latest"], topology: "standalone", os: "linux" }
2035+
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "latest"],
2036+
topology: "standalone", os: "linux" }
20312037
display_name: "${version} ${topology} ${api-version} "
20322038
tags: ["tests-variant"]
20332039
tasks:
20342040
- name: "test"
20352041

20362042
- matrix_name: "tests-load-balancer-secure"
2037-
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk17"], version: ["5.0", "6.0", "7.0", "latest"], topology: "sharded-cluster", os: "ubuntu" }
2043+
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "latest"], topology: "sharded-cluster",
2044+
os: "ubuntu" }
20382045
display_name: "Load Balancer ${version} ${auth} ${ssl} ${jdk} ${os}"
20392046
tasks:
20402047
- name: "load-balancer-test"
20412048

20422049
- matrix_name: "tests-serverless"
2043-
matrix_spec: { jdk: ["jdk17"], os: "ubuntu" }
2050+
matrix_spec: { jdk: ["jdk21"], os: "ubuntu" }
20442051
display_name: "Serverless"
20452052
tasks:
20462053
- name: "serverless-test"
20472054

20482055
- matrix_name: "tests-slow"
2049-
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk17", version: ["7.0"], topology: "standalone", os: "linux" }
2056+
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk21", version: ["7.0"], topology: "standalone", os: "linux" }
20502057
display_name: "Slow: ${version} ${topology} ${ssl} ${jdk} ${os} "
20512058
tags: ["tests-slow-variant"]
20522059
tasks:
@@ -2088,7 +2095,7 @@ buildvariants:
20882095
- name: "socket-test"
20892096

20902097
- matrix_name: "test-gssapi"
2091-
matrix_spec: { jdk: ["jdk8", "jdk17"], os: "linux", gssapi-login-context-name: "*"}
2098+
matrix_spec: { jdk: ["jdk8", "jdk17", "jdk21"], os: "linux", gssapi-login-context-name: "*"}
20922099
display_name: "GSSAPI (Kerberos) Auth test ${jdk} ${os} ${gssapi-login-context-name}"
20932100
tags: ["test-gssapi-variant"]
20942101
tasks:
@@ -2120,15 +2127,15 @@ buildvariants:
21202127
- name: "test_atlas_task_group_search_indexes"
21212128

21222129
- matrix_name: "aws-auth-test"
2123-
matrix_spec: { ssl: "nossl", jdk: ["jdk8", "jdk17"], version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu",
2130+
matrix_spec: { ssl: "nossl", jdk: ["jdk8", "jdk17", "jdk21"], version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu",
21242131
aws-credential-provider: "*" }
21252132
display_name: "MONGODB-AWS Basic Auth test ${version} ${jdk} ${aws-credential-provider}"
21262133
run_on: ubuntu2004-small
21272134
tasks:
21282135
- name: "aws-auth-test-with-regular-aws-credentials"
21292136

21302137
- matrix_name: "aws-ec2-auth-test"
2131-
matrix_spec: { ssl: "nossl", jdk: ["jdk17"], version: ["7.0"], os: "ubuntu", aws-credential-provider: "*" }
2138+
matrix_spec: { ssl: "nossl", jdk: ["jdk21"], version: ["7.0"], os: "ubuntu", aws-credential-provider: "*" }
21322139
display_name: "MONGODB-AWS Advanced Auth test ${version} ${jdk} ${aws-credential-provider}"
21332140
run_on: ubuntu2004-small
21342141
tasks:
@@ -2139,14 +2146,14 @@ buildvariants:
21392146
- name: "aws-auth-test-with-web-identity-credentials"
21402147

21412148
- matrix_name: "accept-api-version-2-test"
2142-
matrix_spec: { ssl: "nossl", auth: "noauth", jdk: "jdk17", version: ["5.0", "6.0", "7.0", "latest"], topology: "standalone", os: "linux" }
2149+
matrix_spec: { ssl: "nossl", auth: "noauth", jdk: "jdk21", version: ["5.0", "6.0", "7.0", "latest"], topology: "standalone", os: "linux" }
21432150
display_name: "Accept API Version 2 ${version}"
21442151
run_on: ubuntu2004-small
21452152
tasks:
21462153
- name: "accept-api-version-2-test"
21472154

21482155
- matrix_name: "ocsp-test"
2149-
matrix_spec: { auth: "noauth", ssl: "ssl", jdk: "jdk17", version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu" }
2156+
matrix_spec: { auth: "noauth", ssl: "ssl", jdk: "jdk21", version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu" }
21502157
display_name: "OCSP test ${version} ${os}"
21512158
tasks:
21522159
- name: ".ocsp"
@@ -2176,14 +2183,14 @@ buildvariants:
21762183
- name: "reactive-streams-tck-test"
21772184

21782185
- matrix_name: "scala-tests"
2179-
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk17", version: ["7.0"], topology: "replicaset", scala: "*", os: "ubuntu" }
2186+
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk21", version: ["7.0"], topology: "replicaset", scala: "*", os: "ubuntu" }
21802187
display_name: "${scala} ${version} ${topology} ${os}"
21812188
tags: ["test-scala-variant"]
21822189
tasks:
21832190
- name: "scala-tests"
21842191

21852192
- matrix_name: "kotlin-tests"
2186-
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: ["jdk8", "jdk17"], version: ["7.0"], topology: "replicaset", os: "ubuntu" }
2193+
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: ["jdk8", "jdk17", "jdk21"], version: ["7.0"], topology: "replicaset", os: "ubuntu" }
21872194
display_name: "Kotlin: ${jdk} ${version} ${topology} ${os}"
21882195
tags: ["test-kotlin-variant"]
21892196
tasks:

.evergreen/javaConfig.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export JDK8="/opt/java/jdk8"
44
export JDK11="/opt/java/jdk11"
55
export JDK17="/opt/java/jdk17"
6+
export JDK21="/opt/java/jdk21"
67

78
if [ -d "$JDK17" ]; then
89
export JAVA_HOME=$JDK17

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ configure(javaCodeCheckedProjects) {
256256
testImplementation platform('org.spockframework:spock-bom:2.1-groovy-3.0')
257257
testImplementation 'org.spockframework:spock-core'
258258
testImplementation 'org.spockframework:spock-junit4'
259-
testImplementation("org.mockito:mockito-core:3.8.0")
260-
testImplementation("org.mockito:mockito-inline:3.8.0")
259+
testImplementation("org.mockito:mockito-core:5.6.0")
261260
testImplementation 'cglib:cglib-nodep:2.2.2'
262261
testImplementation 'org.objenesis:objenesis:1.3'
263262
testImplementation 'org.hamcrest:hamcrest-all:1.3'

driver-reactive-streams/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies {
3131
testImplementation project(':driver-core').sourceSets.test.output
3232
testImplementation 'org.reactivestreams:reactive-streams-tck:1.0.4'
3333
testImplementation 'io.projectreactor:reactor-test'
34-
testImplementation 'org.mockito:mockito-junit-jupiter:3.5.13'
34+
testImplementation 'org.mockito:mockito-junit-jupiter:5.6.0'
3535
testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly')
3636
}
3737

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ scalaVersions=2.11.12,2.12.15,2.13.6
2020
defaultScalaVersions=2.13.6
2121
runOnceTasks=clean,release
2222
org.gradle.java.installations.auto-download=false
23-
org.gradle.java.installations.fromEnv=JDK8,JDK11,JDK17
23+
org.gradle.java.installations.fromEnv=JDK8,JDK11,JDK17,JDK21

0 commit comments

Comments
 (0)