Polish
See gh-21009
This commit is contained in:
committed by
Stephane Nicoll
parent
5b1b7bcb9b
commit
5eb5bf0a2d
@@ -102,7 +102,7 @@ class LifecycleTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void executeWhenAleadyRunThrowsException() throws Exception {
|
||||
void executeWhenAlreadyRunThrowsException() throws Exception {
|
||||
given(this.docker.container().create(any())).willAnswer(answerWithGeneratedContainerId());
|
||||
given(this.docker.container().create(any(), any())).willAnswer(answerWithGeneratedContainerId());
|
||||
given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null));
|
||||
@@ -211,9 +211,9 @@ class LifecycleTests {
|
||||
|
||||
static class TestLifecycle extends Lifecycle {
|
||||
|
||||
TestLifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReferece,
|
||||
TestLifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReference,
|
||||
EphemeralBuilder builder) {
|
||||
super(log, docker, request, runImageReferece, builder);
|
||||
super(log, docker, request, runImageReference, builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -190,7 +190,7 @@ class DockerApiTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void removeWhenReferenceIsNulllThrowsException() {
|
||||
void removeWhenReferenceIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.api.remove(null, true))
|
||||
.withMessage("Reference must not be null");
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ abstract class ProgressUpdateEventTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void getProgressDetailsReturnsProgresssDetails() {
|
||||
void getProgressDetailsReturnsProgressDetails() {
|
||||
ProgressUpdateEvent event = createEvent();
|
||||
assertThat(event.getProgressDetail().getCurrent()).isEqualTo(1);
|
||||
assertThat(event.getProgressDetail().getTotal()).isEqualTo(2);
|
||||
|
||||
@@ -177,7 +177,7 @@ class HttpClientTransportTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void executeWhenResposeIsIn400RangeShouldThrowDockerException() throws IOException {
|
||||
void executeWhenResponseIsIn400RangeShouldThrowDockerException() throws IOException {
|
||||
given(this.entity.getContent()).willReturn(getClass().getResourceAsStream("errors.json"));
|
||||
given(this.statusLine.getStatusCode()).willReturn(404);
|
||||
assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri))
|
||||
@@ -185,7 +185,7 @@ class HttpClientTransportTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void executeWhenResposeIsIn500RangeShouldThrowDockerException() {
|
||||
void executeWhenResponseIsIn500RangeShouldThrowDockerException() {
|
||||
given(this.statusLine.getStatusCode()).willReturn(500);
|
||||
assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri))
|
||||
.satisfies((ex) -> assertThat(ex.getErrors()).isNull());
|
||||
|
||||
@@ -45,8 +45,8 @@ class ImageConfigTests extends AbstractJsonTests {
|
||||
@Test
|
||||
void getLabelsReturnsLabels() throws Exception {
|
||||
ImageConfig imageConfig = getImageConfig();
|
||||
Map<String, String> lables = imageConfig.getLabels();
|
||||
assertThat(lables).hasSize(4).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
|
||||
Map<String, String> labels = imageConfig.getLabels();
|
||||
assertThat(labels).hasSize(4).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -46,8 +46,8 @@ class ImageTests extends AbstractJsonTests {
|
||||
@Test
|
||||
void getConfigLabelsReturnsLabels() throws Exception {
|
||||
Image image = getImage();
|
||||
Map<String, String> lables = image.getConfig().getLabels();
|
||||
assertThat(lables).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
|
||||
Map<String, String> labels = image.getConfig().getLabels();
|
||||
assertThat(labels).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -129,7 +129,7 @@ class BootJarTests extends AbstractBootArchiveTests<TestBootJar> {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenJarIsLayeredWithCustomStrategiesThenLayersIndexIsPresentAndCorrent() throws IOException {
|
||||
void whenJarIsLayeredWithCustomStrategiesThenLayersIndexIsPresentAndCorrect() throws IOException {
|
||||
File jar = createLayeredJar((layered) -> {
|
||||
layered.application((application) -> {
|
||||
application.intoLayer("resources", (spec) -> spec.include("static/**"));
|
||||
|
||||
@@ -68,7 +68,7 @@ class LayerToolsJarModeTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void mainWithNoParamersShowsHelp() {
|
||||
void mainWithNoParametersShowsHelp() {
|
||||
new LayerToolsJarMode().run("layertools", NO_ARGS);
|
||||
assertThat(this.out).hasSameContentAsResource("help-output.txt");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -167,8 +167,8 @@ class CentralDirectoryEndRecord {
|
||||
|
||||
private int numberOfRecords;
|
||||
|
||||
private Zip64End(RandomAccessData data, int centratDirectoryEndOffset) throws IOException {
|
||||
this(data, new Zip64Locator(data, centratDirectoryEndOffset));
|
||||
private Zip64End(RandomAccessData data, int centralDirectoryEndOffset) throws IOException {
|
||||
this(data, new Zip64Locator(data, centralDirectoryEndOffset));
|
||||
}
|
||||
|
||||
private Zip64End(RandomAccessData data, Zip64Locator locator) throws IOException {
|
||||
|
||||
@@ -238,7 +238,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void whenADependendencyHasTestScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) {
|
||||
void whenADependencyHasTestScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("jar-test-scope").execute((project) -> {
|
||||
File main = new File(project, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar");
|
||||
assertThat(jar(main)).doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/log4j")
|
||||
|
||||
@@ -41,21 +41,21 @@ class ImageTests {
|
||||
|
||||
@Test
|
||||
void getBuildRequestWhenNameIsNullDeducesName() {
|
||||
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
|
||||
}
|
||||
|
||||
@Test
|
||||
void getBuildEquestWhenNameIsSetUsesName() {
|
||||
void getBuildRequestWhenNameIsSetUsesName() {
|
||||
Image image = new Image();
|
||||
image.name = "demo";
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.getName().toString()).isEqualTo("docker.io/library/demo:latest");
|
||||
}
|
||||
|
||||
@Test
|
||||
void getBuildRequestWhenNoCustomizationsUsesDefaults() {
|
||||
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
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("docker.io/cloudfoundry/cnb:bionic-platform-api");
|
||||
assertThat(request.getEnv()).isEmpty();
|
||||
@@ -67,7 +67,7 @@ class ImageTests {
|
||||
void getBuildRequestWhenHasBuilderUsesBuilder() {
|
||||
Image image = new Image();
|
||||
image.builder = "springboot/builder:2.2.x";
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.getBuilder().toString()).isEqualTo("docker.io/springboot/builder:2.2.x");
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class ImageTests {
|
||||
void getBuildRequestWhenHasEnvUsesEnv() {
|
||||
Image image = new Image();
|
||||
image.env = Collections.singletonMap("test", "test");
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.getEnv()).containsExactly(entry("test", "test"));
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class ImageTests {
|
||||
void getBuildRequestWhenHasCleanCacheUsesCleanCache() {
|
||||
Image image = new Image();
|
||||
image.cleanCache = true;
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.isCleanCache()).isTrue();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class ImageTests {
|
||||
void getBuildRequestWhenHasVerboseLoggingUsesVerboseLogging() {
|
||||
Image image = new Image();
|
||||
image.verboseLogging = true;
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent());
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.isVerboseLogging()).isTrue();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class ImageTests {
|
||||
"jar", null, new DefaultArtifactHandler());
|
||||
}
|
||||
|
||||
private Function<Owner, TarArchive> mockAplicationContent() {
|
||||
private Function<Owner, TarArchive> mockApplicationContent() {
|
||||
return (owner) -> null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user