@Test
  public void testConfigureBasicAuth()
      throws IOException, InterruptedException, GeneralSecurityException, URISyntaxException,
          RegistryException {
    String basicAuth = "HTTP/1.1 200 OK\nContent-Length: 56789\n\n";
    registry = new TestWebServer(false, Arrays.asList(basicAuth), 1);
    RegistryClient registryClient = createRegistryClient(Credential.from("user", "pass"));
    registryClient.configureBasicAuth();

    Optional<BlobDescriptor> digestAndSize = registryClient.checkBlob(digest);
    Assert.assertEquals(56789, digestAndSize.get().getSize());
    MatcherAssert.assertThat(
        registry.getInputRead(), CoreMatchers.containsString("Authorization: Basic dXNlcjpwYXNz"));
  }
Tests for {@link RegistryClient}. More comprehensive tests can be found in the integration tests.
jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryClientTest.java