From e7365d3cfa7b417fdcb24c3ed35f3c4fe3cd401d Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 15 Dec 2024 11:12:32 -0800 Subject: [PATCH] check for build success --- .../spring/ProjectGeneratorIntegrationTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/initializr-generator-spring/src/test/java/io/spring/initializr/generator/spring/ProjectGeneratorIntegrationTests.java b/initializr-generator-spring/src/test/java/io/spring/initializr/generator/spring/ProjectGeneratorIntegrationTests.java index 80906a1cb9..014701c135 100644 --- a/initializr-generator-spring/src/test/java/io/spring/initializr/generator/spring/ProjectGeneratorIntegrationTests.java +++ b/initializr-generator-spring/src/test/java/io/spring/initializr/generator/spring/ProjectGeneratorIntegrationTests.java @@ -37,6 +37,8 @@ import org.junit.jupiter.api.io.TempDir; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Fail.fail; + /** * Tests for {@link ProjectGenerator} that uses all available @@ -106,6 +108,14 @@ private void runBuild(Path mavenHome, Path projectDirectory, MutableProjectDescr processBuilder.redirectOutput(output.toFile()); assertThat(processBuilder.start().waitFor()).describedAs(String.join("\n", Files.readAllLines(output))) .isEqualTo(0); + + if (description.getBuildSystem().id().equals(GradleBuildSystem.ID)) { + assertThat(output.toFile()).content().contains("BUILD SUCCESSFUL"); + } else if (description.getBuildSystem().id().equals(MavenBuildSystem.ID)) { + assertThat(output.toFile()).content().contains("BUILD SUCCESS"); + } else { + fail("unexpected Build System: " + description.getBuildSystem().id()); + } } private ProcessBuilder createProcessBuilder(Path directory, BuildSystem buildSystem, Path home) {