Add CI with Java 24

Closes gh-44205
This commit is contained in:
Andy Wilkinson 2025-02-11 11:34:43 +00:00
parent b8f64681ad
commit 30d7af4e38
6 changed files with 41 additions and 3 deletions

View File

@ -25,6 +25,9 @@ jobs:
toolchain: false toolchain: false
- version: 23 - version: 23
toolchain: true toolchain: true
- version: 24
early-access: true
toolchain: true
exclude: exclude:
- os: - os:
name: Linux name: Linux

View File

@ -154,3 +154,7 @@ plugins.withType(EclipsePlugin) {
} }
} }
} }
toolchain {
maximumCompatibleJavaVersion = JavaLanguageVersion.of(23)
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2024 the original author or authors. * Copyright 2012-2025 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -44,6 +44,8 @@ import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.mockito.InOrder; import org.mockito.InOrder;
import org.springframework.boot.testsupport.web.servlet.ExampleServlet; import org.springframework.boot.testsupport.web.servlet.ExampleServlet;
@ -308,6 +310,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto
} }
@Test @Test
@DisabledForJreRange(min = JRE.JAVA_24)
void sslRestrictedProtocolsRSATLS12Success() throws Exception { void sslRestrictedProtocolsRSATLS12Success() throws Exception {
testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.2" }, testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.2" },
new String[] { "TLS_RSA_WITH_AES_128_CBC_SHA256" }); new String[] { "TLS_RSA_WITH_AES_128_CBC_SHA256" });

View File

@ -42,3 +42,7 @@ dependencies {
systemTestImplementation("org.testcontainers:junit-jupiter") systemTestImplementation("org.testcontainers:junit-jupiter")
systemTestImplementation("org.testcontainers:testcontainers") systemTestImplementation("org.testcontainers:testcontainers")
} }
toolchain {
maximumCompatibleJavaVersion = JavaLanguageVersion.of(23)
}

View File

@ -67,7 +67,18 @@ class LoaderIntegrationTests {
.withLogConsumer(this.output) .withLogConsumer(this.output)
.withCopyFileToContainer(MountableFile.forHostPath(findApplication().toPath()), "/app.jar") .withCopyFileToContainer(MountableFile.forHostPath(findApplication().toPath()), "/app.jar")
.withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5))) .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5)))
.withCommand("java", "-jar", "app.jar"); .withCommand(command(javaRuntime));
}
private String[] command(JavaRuntime javaRuntime) {
List<String> command = new ArrayList<>();
command.add("java");
if (javaRuntime.version == JavaVersion.TWENTY_FOUR) {
command.add("--enable-native-access=ALL-UNNAMED");
}
command.add("-jar");
command.add("app.jar");
return command.toArray(new String[0]);
} }
private File findApplication() { private File findApplication() {
@ -84,6 +95,7 @@ class LoaderIntegrationTests {
javaRuntimes.add(JavaRuntime.oracleJdk17()); javaRuntimes.add(JavaRuntime.oracleJdk17());
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO));
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE));
javaRuntimes.add(JavaRuntime.openJdkEarlyAccess(JavaVersion.TWENTY_FOUR));
return javaRuntimes.stream().filter(JavaRuntime::isCompatible); return javaRuntimes.stream().filter(JavaRuntime::isCompatible);
} }

View File

@ -90,7 +90,18 @@ class LoaderIntegrationTests {
.withLogConsumer(this.output) .withLogConsumer(this.output)
.withCopyFileToContainer(findApplication(name, classifier), "/app.jar") .withCopyFileToContainer(findApplication(name, classifier), "/app.jar")
.withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5))) .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5)))
.withCommand("java", "-jar", "app.jar"); .withCommand(command(javaRuntime));
}
private String[] command(JavaRuntime javaRuntime) {
List<String> command = new ArrayList<>();
command.add("java");
if (javaRuntime.version == JavaVersion.TWENTY_FOUR) {
command.add("--enable-native-access=ALL-UNNAMED");
}
command.add("-jar");
command.add("app.jar");
return command.toArray(new String[0]);
} }
private MountableFile findApplication(String name, String classifier) { private MountableFile findApplication(String name, String classifier) {
@ -112,6 +123,7 @@ class LoaderIntegrationTests {
javaRuntimes.add(JavaRuntime.oracleJdk17()); javaRuntimes.add(JavaRuntime.oracleJdk17());
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO));
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE));
javaRuntimes.add(JavaRuntime.openJdkEarlyAccess(JavaVersion.TWENTY_FOUR));
return javaRuntimes.stream().filter(JavaRuntime::isCompatible); return javaRuntimes.stream().filter(JavaRuntime::isCompatible);
} }