Search in sources :

Example 51 with BuildResult

use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.

the class PackagingDocumentationTests method bootBuildImageWithBuilder.

@TestTemplate
void bootBuildImageWithBuilder() {
    BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-builder").build("bootBuildImageBuilder");
    assertThat(result.getOutput()).contains("builder=mine/java-cnb-builder").contains("runImage=mine/java-cnb-run");
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) TestTemplate(org.junit.jupiter.api.TestTemplate)

Example 52 with BuildResult

use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.

the class PackagingDocumentationTests method bootBuildImageWithDockerUserAuth.

@TestTemplate
void bootBuildImageWithDockerUserAuth() {
    BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-auth-user").build("bootBuildImageDocker");
    assertThat(result.getOutput()).contains("username=user").contains("password=secret").contains("url=https://docker.example.com/v1/").contains("email=user@example.com");
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) TestTemplate(org.junit.jupiter.api.TestTemplate)

Example 53 with BuildResult

use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.

the class PackagingDocumentationTests method bootBuildImageWithDockerHost.

@TestTemplate
void bootBuildImageWithDockerHost() {
    BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-host").build("bootBuildImageDocker");
    assertThat(result.getOutput()).contains("host=tcp://192.168.99.100:2376").contains("tlsVerify=true").contains("certPath=/home/users/.minikube/certs");
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) TestTemplate(org.junit.jupiter.api.TestTemplate)

Example 54 with BuildResult

use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.

the class PackagingDocumentationTests method bootBuildImageWithCustomBuildpackJvmVersion.

@TestTemplate
void bootBuildImageWithCustomBuildpackJvmVersion() {
    BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-env").build("bootBuildImageEnvironment");
    assertThat(result.getOutput()).contains("BP_JVM_VERSION=8.*");
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) TestTemplate(org.junit.jupiter.api.TestTemplate)

Example 55 with BuildResult

use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.

the class PackagingDocumentationTests method bootBuildImageWithCustomImageName.

@TestTemplate
void bootBuildImageWithCustomImageName() {
    BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-name").build("bootBuildImageName");
    assertThat(result.getOutput()).contains("example.com/library/" + this.gradleBuild.getProjectDir().getName());
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) TestTemplate(org.junit.jupiter.api.TestTemplate)

Aggregations

BuildResult (org.gradle.testkit.runner.BuildResult)143 File (java.io.File)62 TestTemplate (org.junit.jupiter.api.TestTemplate)60 Test (org.junit.Test)47 Test (org.junit.jupiter.api.Test)20 StringWriter (java.io.StringWriter)19 GradleRunner (org.gradle.testkit.runner.GradleRunner)17 Test (org.testng.annotations.Test)10 ImageReference (org.springframework.boot.buildpack.platform.docker.type.ImageReference)8 JarFile (java.util.jar.JarFile)7 ArrayList (java.util.ArrayList)6 List (java.util.List)6 TestHelpers.findFile (me.tatarka.TestHelpers.findFile)6 TestHelpers.writeFile (me.tatarka.TestHelpers.writeFile)6 ContainerConfig (com.github.dockerjava.api.model.ContainerConfig)5 FileWriter (java.io.FileWriter)5 IOException (java.io.IOException)5 PrintWriter (java.io.PrintWriter)5 Path (java.nio.file.Path)5 BufferedReader (java.io.BufferedReader)4