@@ -0,0 +1,2778 @@
+/*-%0A * -%5C-%5C-%0A * docker-client%0A * --%0A * Copyright (C) 2016 - 2018 Spotify AB%0A * --%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * -/-/-%0A */%0A%0Apackage com.spotify.docker.client;%0A%0Aimport static com.spotify.docker.client.SystemCredentialHelperDelegate.readServerAuthDetails;%0Aimport static com.spotify.hamcrest.pojo.IsPojo.pojo;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.hamcrest.Matchers.nullValue;%0A%0Aimport com.spotify.docker.client.messages.DockerCredentialHelperAuth;%0Aimport java.io.BufferedReader;%0Aimport java.io.StringReader;%0Aimport org.junit.Test;%0A%0Apublic class SystemCredentialHelperDelegateTest %7B%0A%0A  @Test%0A  public void testReadServerAuthDetails() throws Exception %7B%0A    final StringReader input = new StringReader(%0A        %22%7B%5C%22Username%5C%22: %5C%22foo%5C%22, %5C%22Secret%5C%22: %5C%22bar%5C%22, %5C%22ServerURL%5C%22: %5C%22example.com%5C%22%7D%22);%0A    final DockerCredentialHelperAuth auth = readServerAuthDetails(new BufferedReader(input));%0A    assertThat(auth, is(pojo(DockerCredentialHelperAuth.class)%0A        .where(%22username%22, is(%22foo%22))%0A        .where(%22secret%22, is(%22bar%22))%0A        .where(%22serverUrl%22, is(%22example.com%22))%0A    ));%0A  %7D%0A%0A  @Test%0A  public void readServerAuthDetailsFromMultipleLines() throws Exception %7B%0A    final StringReader input = new StringReader(%0A        %22%7B%5Cn%22%0A        + %22  %5C%22Username%5C%22: %5C%22foo%5C%22,%5Cn%22%0A        + %22  %5C%22Secret%5C%22: %5C%22bar%5C%22,%5Cn%22%0A        + %22  %5C%22ServerURL%5C%22: %5C%22example.com%5C%22%22%0A        + %22%5Cn%7D%22);%0A    final DockerCredentialHelperAuth auth = readServerAuthDetails(new BufferedReader(input));%0A    assertThat(auth, is(pojo(DockerCredentialHelperAuth.class)%0A        .where(%22username%22, is(%22foo%22))%0A        .where(%22secret%22, is(%22bar%22))%0A        .where(%22serverUrl%22, is(%22example.com%22))%0A    ));%0A  %7D%0A%0A  @Test%0A  public void readServerAuthDetailsNoServerUrl() throws Exception %7B%0A    final StringReader input = new StringReader(%0A        %22%7B%5Cn%22%0A        + %22  %5C%22Username%5C%22: %5C%22foo%5C%22,%5Cn%22%0A        + %22  %5C%22Secret%5C%22: %5C%22bar%5C%22%5Cn%22%0A        + %22%5Cn%7D%22);%0A    final DockerCredentialHelperAuth auth = readServerAuthDetails(new BufferedReader(input));%0A    assertThat(auth, is(pojo(DockerCredentialHelperAuth.class)%0A        .where(%22username%22, is(%22foo%22))%0A        .where(%22secret%22, is(%22bar%22))%0A        .where(%22serverUrl%22, is(nullValue()))%0A    ));%0A  %7D%0A%7D%0A

Add tests for SystemCredentialHelperDelegate