@@ -0,0 +1,1548 @@
+/*%0A * Copyright 2012-2017 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.springframework.boot.test;%0A%0Aimport org.junit.AssumptionViolatedException;%0A%0Aimport org.springframework.boot.system.JavaVersion;%0A%0A/**%0A * Provides utility methods that allow JUnit tests to %7B@link org.junit.Assume%7D certain%0A * conditions hold %7B@code true%7D. If the assumption fails, it means the test should be%0A * skipped.%0A *%0A * @author Stephane Nicoll%0A * @since 2.0.0%0A */%0Apublic abstract class Assume %7B%0A%0A%09/**%0A%09 * Assume that the specified %7B@link JavaVersion%7D is the one currently available.%0A%09 * @param version the expected Java version%0A%09 * @throws AssumptionViolatedException if the assumption fails%0A%09 */%0A%09public static void javaVersion(JavaVersion version) %7B%0A%09%09JavaVersion currentVersion = JavaVersion.getJavaVersion();%0A%09%09boolean outcome = currentVersion.compareTo(JavaVersion.NINE) %3C 0;%0A%09%09org.junit.Assume.assumeTrue(String.format(%0A%09%09%09%09%22This test should run on %25s (got %25s)%22, version, currentVersion), outcome);%0A%09%7D%0A%0A%7D%0A

Add a way to run a test only with a certain Java version