Update spring-boot-loader-tests to use docker-test plugin

See gh-41228
This commit is contained in:
Andy Wilkinson 2024-06-25 12:04:40 +01:00
parent d5ef5e9c9d
commit edc582800b
9 changed files with 13 additions and 16 deletions

View File

@ -1,7 +1,7 @@
plugins {
id "java"
id "org.springframework.boot.conventions"
id "org.springframework.boot.integration-test"
id "org.springframework.boot.docker-test"
id "de.undercouch.download"
}
@ -21,16 +21,15 @@ dependencies {
app project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter", configuration: "mavenRepository")
app("org.bouncycastle:bcprov-jdk18on:1.78.1")
intTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
intTestImplementation("org.testcontainers:junit-jupiter")
intTestImplementation("org.testcontainers:testcontainers")
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
from configurations.app
into "${buildDir}/int-test-maven-repository"
into "${buildDir}/docker-test-maven-repository"
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
@ -74,10 +73,10 @@ task syncJdkDownloads(type: Sync) {
into "${project.buildDir}/downloads/jdk/oracle/"
}
processIntTestResources {
tasks.named("processDockerTestResources").configure {
dependsOn syncJdkDownloads
}
intTest {
tasks.named("dockerTest").configure {
dependsOn buildApp, buildSignedJarApp
}

View File

@ -1,14 +1,12 @@
plugins {
id "java"
id "org.springframework.boot"
// id 'org.springframework.boot' version '3.1.4'
// id 'io.spring.dependency-management' version '1.1.3'
}
apply plugin: "io.spring.dependency-management"
repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"}
maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }

View File

@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"}
maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }

View File

@ -8,7 +8,7 @@ plugins {
apply plugin: "io.spring.dependency-management"
repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"}
maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }

View File

@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"}
maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }

View File

@ -156,7 +156,7 @@ class LoaderIntegrationTests {
static JavaRuntime oracleJdk17() {
ImageFromDockerfile image = new ImageFromDockerfile("spring-boot-loader/oracle-jdk");
image.withFileFromFile("Dockerfile", new File("src/intTest/resources/conf/oracle-jdk-17/Dockerfile"));
image.withFileFromFile("Dockerfile", new File("src/dockerTest/resources/conf/oracle-jdk-17/Dockerfile"));
for (File file : new File("build/downloads/jdk/oracle").listFiles()) {
image.withFileFromFile("downloads/" + file.getName(), file);
}