From edc582800beb1b9f96ea83cc328538ff70810022 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 25 Jun 2024 12:04:40 +0100 Subject: [PATCH] Update spring-boot-loader-tests to use docker-test plugin See gh-41228 --- .../spring-boot-loader-tests/build.gradle | 17 ++++++++--------- .../spring-boot-loader-tests-app/build.gradle | 4 +--- .../settings.gradle | 2 +- .../build.gradle | 2 +- .../settings.gradle | 2 +- .../boot/loader/LoaderIntegrationTests.java | 2 +- .../resources/conf/oracle-jdk-17/Dockerfile | 0 .../resources/conf/oracle-jdk-17/README.adoc | 0 .../resources/logback.xml | 0 9 files changed, 13 insertions(+), 16 deletions(-) rename spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/{intTest => dockerTest}/java/org/springframework/boot/loader/LoaderIntegrationTests.java (98%) rename spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/{intTest => dockerTest}/resources/conf/oracle-jdk-17/Dockerfile (100%) rename spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/{intTest => dockerTest}/resources/conf/oracle-jdk-17/README.adoc (100%) rename spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/{intTest => dockerTest}/resources/logback.xml (100%) 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 2dde25c0a5f..5e4e6642c84 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 @@ -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 } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-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 index 8f8cf37e3aa..209479c32ca 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-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 @@ -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" } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-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 index 06d9554ad0d..40b46b93926 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-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 @@ -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" } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/build.gradle index 321d867c338..e3554106e64 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/build.gradle @@ -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" } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/settings.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/settings.gradle index 06d9554ad0d..40b46b93926 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/settings.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-signed-jar/settings.gradle @@ -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" } 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/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java similarity index 98% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java index 6a33a39fe2b..82d386566c4 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/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java @@ -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); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/conf/oracle-jdk-17/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/conf/oracle-jdk-17/Dockerfile similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/conf/oracle-jdk-17/Dockerfile rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/conf/oracle-jdk-17/Dockerfile diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/conf/oracle-jdk-17/README.adoc b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/conf/oracle-jdk-17/README.adoc similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/conf/oracle-jdk-17/README.adoc rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/conf/oracle-jdk-17/README.adoc diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/logback.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/logback.xml similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/resources/logback.xml rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/resources/logback.xml