Skip to content

Commit

Permalink
Add TWENTY_THREE to JavaVersion enum
Browse files Browse the repository at this point in the history
This commit uses JRE#OTHER as JUnit does not have support for Java 23
yet, see junit-team/junit5#3918

Closes gh-41710
  • Loading branch information
snicoll committed Aug 7, 2024
1 parent 00cfe4d commit 9c5b85b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.springframework.boot.system;

import java.io.Console;
import java.text.NumberFormat;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -70,7 +71,13 @@ public enum JavaVersion {
* Java 22.
* @since 3.2.4
*/
TWENTY_TWO("22", Console.class, "isTerminal");
TWENTY_TWO("22", Console.class, "isTerminal"),

/**
* Java 23.
* @since 3.2.9
*/
TWENTY_THREE("23", NumberFormat .class, "isStrict");

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@ void currentJavaVersionTwentyTwo() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.TWENTY_TWO);
}

@Test
@EnabledOnJre(JRE.OTHER)
void currentJavaVersionTwentyThree() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.TWENTY_THREE);
}

}

0 comments on commit 9c5b85b

Please sign in to comment.