Add Java 14 to JavaVersion enumeration

See gh-19511
This commit is contained in:
Dmytro Nosan 2020-01-02 22:20:51 +02:00 committed by Stephane Nicoll
parent 47481464ff
commit a5a3a020b6
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
package org.springframework.boot.system; package org.springframework.boot.system;
import java.lang.invoke.MethodHandles;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -60,7 +61,11 @@ public enum JavaVersion {
/** /**
* Java 13. * Java 13.
*/ */
THIRTEEN("13", String.class, "stripIndent"); THIRTEEN("13", String.class, "stripIndent"),
/**
* Java 14.
*/
FOURTEEN("14", MethodHandles.Lookup.class, "hasFullPrivilegeAccess");
private final String name; private final String name;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -115,4 +115,10 @@ class JavaVersionTests {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.THIRTEEN); assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.THIRTEEN);
} }
@Test
@EnabledOnJre(JRE.JAVA_14)
void currentJavaVersionFourteen() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.FOURTEEN);
}
} }