Merge branch '2.7.x'

Closes gh-32261
pull/32224/head
Andy Wilkinson 2 years ago
commit e112657e1a

@ -21,6 +21,7 @@ import java.time.Duration;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import org.springframework.util.ClassUtils;
@ -41,7 +42,12 @@ public enum JavaVersion {
/**
* Java 18.
*/
EIGHTEEN("18", Duration.class, "isPositive");
EIGHTEEN("18", Duration.class, "isPositive"),
/**
* Java 19.
*/
NINETEEN("19", Future.class, "state");
private final String name;

@ -17,6 +17,7 @@
package org.springframework.boot.system;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
@ -91,4 +92,14 @@ class JavaVersionTests {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.EIGHTEEN);
}
@Test
@EnabledIf("java19")
void currentJavaVersionNineteen() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.NINETEEN);
}
static boolean java19() {
return "19".equals(System.getProperty("java.version"));
}
}

Loading…
Cancel
Save