diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle index 4cad9da18d..f0b5d3fb9b 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle @@ -28,8 +28,8 @@ task syncMavenRepository(type: Sync) { } task syncAppSource(type: Sync) { - from "app" - into "${buildDir}/app" + from "spring-boot-launch-script-tests-app" + into "${buildDir}/spring-boot-launch-script-tests-app" filter { line -> line.replace("id \"org.springframework.boot\"", "id \"org.springframework.boot\" version \"${project.version}\"") } @@ -37,7 +37,7 @@ task syncAppSource(type: Sync) { task buildApp(type: GradleBuild) { dependsOn syncAppSource, syncMavenRepository - dir = "${buildDir}/app" + dir = "${buildDir}/spring-boot-launch-script-tests-app" startParameter.buildCacheEnabled = false tasks = ["build"] } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/build.gradle similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/build.gradle rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/build.gradle diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/settings.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/settings.gradle similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/settings.gradle rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/settings.gradle diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java index dd374d479a..64fce246ad 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java @@ -30,6 +30,7 @@ import org.testcontainers.images.builder.ImageFromDockerfile; import org.testcontainers.utility.MountableFile; import org.springframework.boot.ansi.AnsiColor; +import org.springframework.util.Assert; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.containsString; @@ -110,12 +111,10 @@ abstract class AbstractLaunchScriptIntegrationTests { } private static File findApplication() { - File appJar = new File("build/app/build/libs/app.jar"); - if (appJar.isFile()) { - return appJar; - } - throw new IllegalStateException( - "Could not find test application in build/app/build/libs directory. Have you built it?"); + String name = String.format("build/%1$s/build/libs/%1$s.jar", "spring-boot-launch-script-tests-app"); + File jar = new File(name); + Assert.state(jar.isFile(), () -> "Could not find " + name + ". Have you built it?"); + return jar; } } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle index 46a8ce7cd9..7a39e57c46 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle @@ -28,8 +28,8 @@ task syncMavenRepository(type: Sync) { } task syncAppSource(type: Sync) { - from "app" - into "${buildDir}/app" + from "spring-boot-loader-tests-app" + into "${buildDir}/spring-boot-loader-tests-app" filter { line -> line.replace("id \"org.springframework.boot\"", "id \"org.springframework.boot\" version \"${project.version}\"") } @@ -37,7 +37,7 @@ task syncAppSource(type: Sync) { task buildApp(type: GradleBuild) { dependsOn syncAppSource, syncMavenRepository - dir = "${buildDir}/app" + dir = "${buildDir}/spring-boot-loader-tests-app" startParameter.buildCacheEnabled = false tasks = ["build"] } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/build.gradle similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/build.gradle rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/build.gradle diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/settings.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/settings.gradle similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/settings.gradle rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/settings.gradle diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java index e8c5408f84..ca1a8a3434 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java @@ -28,6 +28,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.testcontainers.utility.DockerImageName; import org.testcontainers.utility.MountableFile; +import org.springframework.util.Assert; + import static org.assertj.core.api.Assertions.assertThat; /** @@ -49,12 +51,10 @@ class LoaderIntegrationTests { .withCommand("java", "-jar", "app.jar"); private static File findApplication() { - File appJar = new File("build/app/build/libs/app.jar"); - if (appJar.isFile()) { - return appJar; - } - throw new IllegalStateException( - "Could not find test application in build/app/build/libs directory. Have you built it?"); + String name = String.format("build/%1$s/build/libs/%1$s.jar", "spring-boot-loader-tests-app"); + File jar = new File(name); + Assert.state(jar.isFile(), () -> "Could not find " + name + ". Have you built it?"); + return jar; } @Test