@Test
  public void testRetrieve_nonexistentServerUrl()
      throws IOException, CredentialHelperNotFoundException {
    try {
      DockerCredentialHelper fakeDockerCredentialHelper =
          new DockerCredentialHelper("fake.server.url", Paths.get(GCR_CREDENTIAL_HELPER));

      fakeDockerCredentialHelper.retrieve();

      Assert.fail("Retrieve should have failed for nonexistent server URL");

    } catch (CredentialHelperUnhandledServerUrlException ex) {
      MatcherAssert.assertThat(
          ex.getMessage(),
          CoreMatchers.containsString(
              "The credential helper (docker-credential-gcr) has nothing for server URL: fake.server.url"));
    }
  }
Tests retrieval via {@code docker-credential-gcr} CLI.
jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/credentials/DockerCredentialHelperIntegrationTest.java