mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Add NINETEEN to JavaVersion enum
Closes gh-32226
This commit is contained in:
parent
3852cf4c44
commit
280ce6390a
@ -23,6 +23,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.springframework.util.ClassUtils;
|
||||
@ -89,7 +90,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;
|
||||
|
||||
@ -145,4 +146,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…
Reference in New Issue
Block a user