use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasRunImageUsesRunImage.
@Test
void getBuildRequestWhenHasRunImageUsesRunImage() {
Image image = new Image();
image.runImage = "springboot/run:latest";
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getRunImage().toString()).isEqualTo("docker.io/springboot/run:latest");
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenNoCustomizationsUsesDefaults.
@Test
void getBuildRequestWhenNoCustomizationsUsesDefaults() {
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder");
assertThat(request.getRunImage()).isNull();
assertThat(request.getEnv()).isEmpty();
assertThat(request.isCleanCache()).isFalse();
assertThat(request.isVerboseLogging()).isFalse();
assertThat(request.getPullPolicy()).isEqualTo(PullPolicy.ALWAYS);
assertThat(request.getBuildpacks()).isEmpty();
assertThat(request.getBindings()).isEmpty();
assertThat(request.getNetwork()).isNull();
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasBuildpacksUsesBuildpacks.
@Test
void getBuildRequestWhenHasBuildpacksUsesBuildpacks() {
Image image = new Image();
image.buildpacks = Arrays.asList("example/buildpack1@0.0.1", "example/buildpack2@0.0.2");
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getBuildpacks()).containsExactly(BuildpackReference.of("example/buildpack1@0.0.1"), BuildpackReference.of("example/buildpack2@0.0.2"));
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenNameIsSetUsesName.
@Test
void getBuildRequestWhenNameIsSetUsesName() {
Image image = new Image();
image.name = "demo";
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/demo:latest");
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasPullPolicyUsesPullPolicy.
@Test
void getBuildRequestWhenHasPullPolicyUsesPullPolicy() {
Image image = new Image();
image.setPullPolicy(PullPolicy.NEVER);
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getPullPolicy()).isEqualTo(PullPolicy.NEVER);
}
Aggregations