Merge branch '3.4.x'

Closes gh-44685
This commit is contained in:
Stéphane Nicoll
2025-03-12 08:59:09 +01:00
20 changed files with 36 additions and 44 deletions

View File

@@ -300,7 +300,7 @@ public class Builder {
}
/**
* Creates{@link DockerLog} instance based on the provided {@link BuildLog}.
* Creates {@link DockerLog} instance based on the provided {@link BuildLog}.
* <p>
* If the provided {@link BuildLog} instance is an {@link AbstractBuildLog}, the
* method returns a {@link BuildLogAdapter}, otherwise it returns a default

View File

@@ -87,7 +87,7 @@ public class DockerApi {
* Create a new {@link DockerApi} instance.
*/
public DockerApi() {
this(HttpTransport.create(null), DockerLog.toSystemOut());
this(null);
}
/**
@@ -96,7 +96,7 @@ public class DockerApi {
* @since 2.4.0
*/
public DockerApi(DockerHostConfiguration dockerHost) {
this(HttpTransport.create(dockerHost), DockerLog.toSystemOut());
this(dockerHost, DockerLog.toSystemOut());
}
/**

View File

@@ -34,7 +34,7 @@ public interface DockerLog {
void log(String message);
/**
* Factory method that returns a {@link DockerLog} the outputs to {@link System#out}.
* Factory method that returns a {@link DockerLog} that outputs to {@link System#out}.
* @return {@link DockerLog} instance that logs to system out
*/
static DockerLog toSystemOut() {
@@ -42,7 +42,7 @@ public interface DockerLog {
}
/**
* Factory method that returns a {@link DockerLog} the outputs to a given
* Factory method that returns a {@link DockerLog} that outputs to a given
* {@link PrintStream}.
* @param out the print stream used to output the log
* @return {@link DockerLog} instance that logs to the given print stream

View File

@@ -47,6 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.assertj.core.api.Assertions.assertThatNoException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
@@ -73,14 +74,12 @@ class BuilderTests {
@Test
void createWithDockerConfiguration() {
Builder builder = new Builder(BuildLog.toSystemOut());
assertThat(builder).isNotNull();
assertThatNoException().isThrownBy(() -> new Builder(BuildLog.toSystemOut()));
}
@Test
void createDockerApiWithLogDockerLogDelegate() {
Builder builder = new Builder(BuildLog.toSystemOut());
assertThat(builder).isNotNull();
assertThat(builder).extracting("docker")
.extracting("system")
.extracting("log")
@@ -90,7 +89,6 @@ class BuilderTests {
@Test
void createDockerApiWithLogDockerSystemOutDelegate() {
Builder builder = new Builder(mock(BuildLog.class));
assertThat(builder).isNotNull();
assertThat(builder).extracting("docker")
.extracting("system")
.extracting("log")