Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Jul 31, 2024
1 parent ca4f885 commit 8b115b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ 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")
.prepare(this::writeLongNameResource)
.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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<classifier>exec</classifier>
<image>
Expand Down

0 comments on commit 8b115b8

Please sign in to comment.