diff --git a/initializr-generator-spring/src/main/java/io/spring/initializr/generator/spring/build/gradle/GradleProjectGenerationConfiguration.java b/initializr-generator-spring/src/main/java/io/spring/initializr/generator/spring/build/gradle/GradleProjectGenerationConfiguration.java index d82a0f6ff5..9b8a4f51a3 100644 --- a/initializr-generator-spring/src/main/java/io/spring/initializr/generator/spring/build/gradle/GradleProjectGenerationConfiguration.java +++ b/initializr-generator-spring/src/main/java/io/spring/initializr/generator/spring/build/gradle/GradleProjectGenerationConfiguration.java @@ -54,6 +54,8 @@ @ConditionalOnBuildSystem(GradleBuildSystem.ID) public class GradleProjectGenerationConfiguration { + private static final int TEST_ORDER = 100; + private final IndentingWriterFactory indentingWriterFactory; public GradleProjectGenerationConfiguration(IndentingWriterFactory indentingWriterFactory) { @@ -186,7 +188,17 @@ SettingsGradleProjectContributor settingsGradleProjectContributor(GradleBuild bu @Bean @ConditionalOnPlatformVersion("2.2.0.M3") BuildCustomizer testTaskContributor() { - return (build) -> build.tasks().customize("test", (test) -> test.invoke("useJUnitPlatform")); + return new BuildCustomizer() { + @Override + public void customize(GradleBuild build) { + build.tasks().customize("test", (test) -> test.invoke("useJUnitPlatform")); + } + + @Override + public int getOrder() { + return TEST_ORDER; + } + }; } @Bean @@ -219,7 +231,17 @@ SettingsGradleProjectContributor settingsGradleKtsProjectContributor(GradleBuild @Bean @ConditionalOnPlatformVersion("2.2.0.M3") BuildCustomizer testTaskContributor() { - return (build) -> build.tasks().customizeWithType("Test", (test) -> test.invoke("useJUnitPlatform")); + return new BuildCustomizer() { + @Override + public void customize(GradleBuild build) { + build.tasks().customizeWithType("Test", (test) -> test.invoke("useJUnitPlatform")); + } + + @Override + public int getOrder() { + return TEST_ORDER; + } + }; } @Bean