Skip to content

Commit

Permalink
Merge branch '2.3.x' into 2.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Dec 18, 2020
2 parents 0730949 + b351288 commit abd0b48
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ 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}\"")
}
}

task buildApp(type: GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = "${buildDir}/app"
dir = "${buildDir}/spring-boot-launch-script-tests-app"
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand Down Expand Up @@ -110,12 +111,10 @@ private LaunchScriptTestContainer(String os, String version, String scriptsDir,
}

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;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ 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}\"")
}
}

task buildApp(type: GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = "${buildDir}/app"
dir = "${buildDir}/spring-boot-loader-tests-app"
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;

import org.springframework.util.Assert;

import static org.assertj.core.api.Assertions.assertThat;

/**
Expand All @@ -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
Expand Down

0 comments on commit abd0b48

Please sign in to comment.