@Test
  public void testAuthPullByWwwAuthenticate_basicAuthRequestedButNullCredential()
      throws IOException, InterruptedException, GeneralSecurityException, URISyntaxException,
          RegistryException {
    String blobResponse = "HTTP/1.1 200 OK\nContent-Length: 5678\n\n";
    registry = new TestWebServer(false, Arrays.asList(blobResponse), 1);

    RegistryClient registryClient = createRegistryClient(null);
    registryClient.authPullByWwwAuthenticate("Basic foo");

    Optional<BlobDescriptor> digestAndSize = registryClient.checkBlob(digest);
    Assert.assertEquals(5678, digestAndSize.get().getSize());

    MatcherAssert.assertThat(
        registry.getInputRead(), CoreMatchers.not(CoreMatchers.containsString("Authorization:")));
  }
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