private void setUpRegistryResponse(Exception exceptionToThrow)
      throws MalformedURLException, IOException {
    Mockito.when(
            mockHttpClient.call(
                Mockito.eq("httpMethod"),
                Mockito.eq(new URL("https://serverUrl/v2/api")),
                Mockito.any()))
        .thenThrow(exceptionToThrow);
  }
Verifies that a response with {@code httpStatusCode} throws {@link
RegistryUnauthorizedException}.
jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java