use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class MavenPublishingIntegrationTests method bootWarCanBePublished.
@TestTemplate
void bootWarCanBePublished() {
BuildResult result = this.gradleBuild.build("publish");
assertThat(result.task(":publish").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(artifactWithSuffix("war")).isFile();
assertThat(artifactWithSuffix("pom")).is(pomWith().groupId("com.example").artifactId(this.gradleBuild.getProjectDir().getName()).version("1.0").packaging("war").noDependencies());
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method failsWithPublishMissingPublishRegistry.
@TestTemplate
void failsWithPublishMissingPublishRegistry() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.buildAndFail("bootBuildImage", "--publishImage");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.FAILED);
assertThat(result.getOutput()).contains("requires docker.publishRegistry");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithTag.
@TestTemplate
void buildsImageWithTag() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
assertThat(result.getOutput()).contains("example.com/myapp:latest");
removeImages(projectName, "example.com/myapp:latest");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method failsWithBuildpackNotInBuilder.
@TestTemplate
void failsWithBuildpackNotInBuilder() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.buildAndFail("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.FAILED);
assertThat(result.getOutput()).contains("'urn:cnb:builder:example/does-not-exist:0.0.1' not found in builder");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithCustomName.
@TestTemplate
void buildsImageWithCustomName() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-name");
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages("example/test-image-name");
}
Aggregations