T call() throws IOException, RegistryException {
    String apiRouteBase = "https://" + registryEndpointRequestProperties.getServerUrl() + "/v2/";
    URL initialRequestUrl = registryEndpointProvider.getApiRoute(apiRouteBase);
    return call(initialRequestUrl);
  }
@Test
  public void testCall_credentialsNotSentOverHttp() throws IOException, RegistryException {
    ResponseException unauthorizedException =
        mockResponseException(HttpStatusCodes.STATUS_CODE_UNAUTHORIZED);
    Mockito.when(unauthorizedException.requestAuthorizationCleared()).thenReturn(true);
    setUpRegistryResponse(unauthorizedException);

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

    } catch (RegistryCredentialsNotSentException ex) {
      Assert.assertEquals(
          "Required credentials for serverUrl/imageName were not sent because the connection was over HTTP",
          ex.getMessage());
    }
  }