From 8b115b80333019bd982a87aad22bead5333076ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 31 Jul 2024 14:25:27 +0200 Subject: [PATCH] Fix test --- .../org/springframework/boot/maven/BuildImageTests.java | 8 ++++---- .../projects/build-image-fork-classifier/pom.xml | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/java/org/springframework/boot/maven/BuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/java/org/springframework/boot/maven/BuildImageTests.java index 9a7563e06a83..140be1a6e0ab 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/java/org/springframework/boot/maven/BuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/java/org/springframework/boot/maven/BuildImageTests.java @@ -116,7 +116,7 @@ void whenPackageIsInvokedWithClassifierTheOriginalArchiveIsFound(MavenBuild mave } @TestTemplate - void whenBuildImageIsInvokedWithClassifierWithoutRepackageTheOriginalArchiveIsFound(MavenBuild mavenBuild) { + void whenBuildImageIsInvokedWithClassifierAndRepackageTheOriginalArchiveIsFound(MavenBuild mavenBuild) { mavenBuild.project("dockerTest", "build-image-fork-classifier") .goals("spring-boot:build-image") .systemProperty("spring-boot.build-image.pullPolicy", "IF_NOT_PRESENT") @@ -124,10 +124,10 @@ void whenBuildImageIsInvokedWithClassifierWithoutRepackageTheOriginalArchiveIsFo .execute((project) -> { File jar = new File(project, "target/build-image-fork-classifier-0.0.1.BUILD-SNAPSHOT.jar"); assertThat(jar).isFile(); - File classifier = new File(project, "target/build-image-fork-classifier-0.0.1.BUILD-SNAPSHOT-test.jar"); - assertThat(classifier).doesNotExist(); + File classifier = new File(project, "target/build-image-fork-classifier-0.0.1.BUILD-SNAPSHOT-exec.jar"); + assertThat(classifier).exists(); assertThat(buildLog(project)).contains("Building image") - .contains("docker.io/library/build-image--fork-classifier:0.0.1.BUILD-SNAPSHOT") + .contains("docker.io/library/build-image-fork-classifier:0.0.1.BUILD-SNAPSHOT") .contains("---> Test Info buildpack building") .contains("---> Test Info buildpack done") .contains("Successfully built image"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/projects/build-image-fork-classifier/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/projects/build-image-fork-classifier/pom.xml index 8aedf2b8c2df..37e4caa7d4c7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/projects/build-image-fork-classifier/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/dockerTest/projects/build-image-fork-classifier/pom.xml @@ -16,6 +16,14 @@ @project.groupId@ @project.artifactId@ @project.version@ + + + repackage + + repackage + + + exec