Add 21 to JavaVersion

See gh-35892
pull/35902/head
Moritz Halbritter 1 year ago
parent 0a607b3edf
commit fb64f6744e

@ -21,6 +21,7 @@ import java.time.Duration;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.SortedSet;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
@ -53,7 +54,12 @@ public enum JavaVersion {
/** /**
* Java 20. * Java 20.
*/ */
TWENTY("20", Class.class, "accessFlags"); TWENTY("20", Class.class, "accessFlags"),
/**
* Java 21.
*/
TWENTY_ONE("21", SortedSet.class, "getFirst");
private final String name; private final String name;

@ -103,4 +103,10 @@ class JavaVersionTests {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.TWENTY); assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.TWENTY);
} }
@Test
@EnabledOnJre(JRE.JAVA_21)
void currentJavaVersionTwentyOne() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.TWENTY_ONE);
}
} }

Loading…
Cancel
Save