@Test
  public void testNewRegistryErrorException_noOutputFromRegistry() {
    ResponseException httpException = Mockito.mock(ResponseException.class);
    // Registry returning null error output
    Mockito.when(httpException.getContent()).thenReturn(null);
    Mockito.when(httpException.getStatusCode()).thenReturn(404);

    RegistryErrorException registryException =
        endpointCaller.newRegistryErrorException(httpException);
    Assert.assertSame(httpException, registryException.getCause());
    Assert.assertEquals(
        "Tried to actionDescription but failed because: registry returned error code 404 "
            + "but did not return any details; possible causes include invalid or wrong reference, or proxy/firewall/VPN interfering \n",
        registryException.getMessage());
  }
Implementation of {@link RegistryEndpointProvider} for testing.
jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java