Merge branch '3.4.x'
Closes gh-44685
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user