Skip to content

Commit

Permalink
Merge branch '2.7.x'
Browse files Browse the repository at this point in the history
Closes gh-32261
  • Loading branch information
wilkinsona committed Sep 8, 2022
2 parents 5352468 + 020e6dd commit e112657
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Expand Up @@ -21,6 +21,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;

import org.springframework.util.ClassUtils;

Expand All @@ -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;

Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -91,4 +92,14 @@ void currentJavaVersionEighteen() {
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"));
}

}

0 comments on commit e112657

Please sign in to comment.