T call() throws IOException, RegistryException {
    String apiRouteBase = "https://" + registryEndpointRequestProperties.getServerUrl() + "/v2/";
    URL initialRequestUrl = registryEndpointProvider.getApiRoute(apiRouteBase);
    return call(initialRequestUrl);
  }
@Test
  public void testCall_credentialsForcedOverHttp() throws IOException, RegistryException {
    ResponseException unauthorizedException =
        mockResponseException(HttpStatusCodes.STATUS_CODE_UNAUTHORIZED);
    setUpRegistryResponse(unauthorizedException);
    System.setProperty(JibSystemProperties.SEND_CREDENTIALS_OVER_HTTP, "true");

    try {
      endpointCaller.call();
      Assert.fail("Call should have failed");

    } catch (RegistryCredentialsNotSentException ex) {
      throw new AssertionError("should have sent credentials", ex);
    } catch (RegistryUnauthorizedException ex) {
      Assert.assertEquals("Unauthorized for serverUrl/imageName", ex.getMessage());
    }
  }