Polish "Lazily query attributes when copying from base configuration"

See gh-37343
This commit is contained in:
Andy Wilkinson
2023-09-14 10:30:49 +01:00
parent 7edc9ebc28
commit a795065555
3 changed files with 26 additions and 5 deletions

View File

@@ -23,11 +23,14 @@ import java.util.List;
import org.gradle.testkit.runner.TaskOutcome;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.springframework.boot.gradle.junit.GradleCompatibility;
import org.springframework.boot.testsupport.gradle.testkit.GradleBuild;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNoException;
/**
* Integration tests for {@link SpringBootAotPlugin}.
@@ -121,6 +124,13 @@ class SpringBootAotPluginIntegrationTests {
.isEqualTo(TaskOutcome.NO_SOURCE);
}
// gh-37343
@TestTemplate
@EnabledOnJre(JRE.JAVA_17)
void applyingAotPluginDoesNotPreventConfigurationOfJavaToolchainLanguageVersion() {
assertThatNoException().isThrownBy(() -> this.gradleBuild.build("help").getOutput());
}
private void writeMainClass(String packageName, String className) throws IOException {
File java = new File(this.gradleBuild.getProjectDir(),
"src/main/java/" + packageName.replace(".", "/") + "/" + className + ".java");