From 39a7b535c8f339732b243b6c2573a34d73cd0540 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..c327d3a32d 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("expected Build System: " + description.getBuildSystem().id()); + } } private ProcessBuilder createProcessBuilder(Path directory, BuildSystem buildSystem, Path home) {