### Question:
RegistryAuthenticator { @VisibleForTesting URL getAuthenticationUrl(@Nullable Credential credential, Map<String, String> repositoryScopes) throws MalformedURLException { return isOAuth2Auth(credential) ? new URL(realm) : new URL(realm + "?" + getServiceScopeRequestParameters(repositoryScopes)); } private  RegistryAuthenticator(
      String realm,
      String service,
      RegistryEndpointRequestProperties registryEndpointRequestProperties,
      @Nullable String userAgent,
      FailoverHttpClient httpClient); Authorization authenticatePull(@Nullable Credential credential); Authorization authenticatePush(@Nullable Credential credential);  }### Answer:
@Test public void getAuthenticationUrl_basicAuth() throws MalformedURLException { Assert.assertEquals( new URL("https: registryAuthenticator.getAuthenticationUrl( null, Collections.singletonMap("someimage", "scope"))); }
@Test public void istAuthenticationUrl_oauth2() throws MalformedURLException { Credential credential = Credential.from("<token>", "oauth2_token"); Assert.assertEquals( new URL("https: registryAuthenticator.getAuthenticationUrl(credential, Collections.emptyMap())); }