From 246f6a1be93faf5a66c4a35b7311536b1aa749a5 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Tue, 23 May 2017 11:38:17 -0400 Subject: [PATCH] ensure RegistryAuth email is set in tests testAuth and testBadAuth is failing on Docker 1.9 and 1.10 because RegistryAuth.email is not set when we send it to the daemon --- .../spotify/docker/client/DefaultDockerClientTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java index 0197a556e..d5bd74c30 100644 --- a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java +++ b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java @@ -310,19 +310,22 @@ public class DefaultDockerClientTest { @Rule public final TestName testName = new TestName(); + private final RegistryAuth registryAuth = RegistryAuth.builder() + .username(AUTH_USERNAME) + .password(AUTH_PASSWORD) + .email("1234@example.com") + .build(); + private final String nameTag = toHexString(ThreadLocalRandom.current().nextLong()); private URI dockerEndpoint; private DefaultDockerClient sut; - private RegistryAuth registryAuth; - private String dockerApiVersion; @Before public void setup() throws Exception { - registryAuth = RegistryAuth.builder().username(AUTH_USERNAME).password(AUTH_PASSWORD).build(); final DefaultDockerClient.Builder builder = DefaultDockerClient.fromEnv(); // Make it easier to test no read timeout occurs by using a smaller value // Such test methods should end in 'NoTimeout' @@ -687,6 +690,7 @@ public void testAuth() throws Exception { public void testBadAuth() throws Exception { final RegistryAuth badRegistryAuth = RegistryAuth.builder() .username(AUTH_USERNAME) + .email("user@example.com") // docker < 1.11 requires email to be set in RegistryAuth .password("foobar") .build(); final int statusCode = sut.auth(badRegistryAuth);