Disable test when Java version is too high

Gradle 7.3.3 does not support Java 20 so the test that verifies that
the plugin fails fast when running on a version of Gradle that it
does not support needs to be disabled on Java 20 and later.

See gh-35931
pull/37018/head
Andy Wilkinson 1 year ago
parent f584d6dbd9
commit 641f00f24c

@ -18,6 +18,8 @@ package org.springframework.boot.gradle.plugin;
import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.BuildResult;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.testsupport.gradle.testkit.GradleBuild; import org.springframework.boot.testsupport.gradle.testkit.GradleBuild;
@ -36,6 +38,7 @@ class SpringBootPluginIntegrationTests {
final GradleBuild gradleBuild = new GradleBuild(); final GradleBuild gradleBuild = new GradleBuild();
@Test @Test
@DisabledForJreRange(min = JRE.JAVA_20)
void failFastWithVersionOfGradle7LowerThanRequired() { void failFastWithVersionOfGradle7LowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("7.3.3").buildAndFail(); BuildResult result = this.gradleBuild.gradleVersion("7.3.3").buildAndFail();
assertThat(result.getOutput()) assertThat(result.getOutput())

Loading…
Cancel
Save