Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
ensure RegistryAuth email is set in tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattnworb committed May 23, 2017
1 parent 9cd8837 commit 246f6a1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 246f6a1

Please sign in to comment.