hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1687908 - in /httpcomponents/httpclient/trunk: fluent-hc/src/main/java/org/apache/http/client/fluent/ httpclient-osgi/src/main/java/org/apache/http/osgi/impl/ httpclient-win/src/main/java/org/apache/http/impl/auth/win/ httpclient-win/src/m...
Date Sat, 27 Jun 2015 10:50:39 GMT
Author: olegk
Date: Sat Jun 27 10:50:38 2015
New Revision: 1687908

URL: http://svn.apache.org/r1687908
Log:
Redesign of CredentialsProvider interface

Added:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/CredentialsProvider.java
      - copied, changed from r1687907, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java   (contents, props changed)
      - copied, changed from r1687907, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java
Removed:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java
Modified:
    httpcomponents/httpclient/trunk/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java
    httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiCredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java
    httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientProxyAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestInternalHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java

Modified: httpcomponents/httpclient/trunk/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java (original)
+++ httpcomponents/httpclient/trunk/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java Sat Jun 27 10:50:38 2015
@@ -43,7 +43,7 @@ import org.apache.http.auth.UsernamePass
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.config.Registry;
@@ -110,7 +110,7 @@ public class Executor {
 
     private final HttpClient httpclient;
     private volatile AuthCache authCache;
-    private volatile CredentialsProvider credentialsProvider;
+    private volatile CredentialsStore credentialsStore;
     private volatile CookieStore cookieStore;
 
     Executor(final HttpClient httpclient) {
@@ -122,16 +122,16 @@ public class Executor {
     /**
      * @since 4.5
      */
-    public Executor use(final CredentialsProvider credentialsProvider) {
-        this.credentialsProvider = credentialsProvider;
+    public Executor use(final CredentialsStore credentialsStore) {
+        this.credentialsStore = credentialsStore;
         return this;
     }
 
     public Executor auth(final AuthScope authScope, final Credentials creds) {
-        if (this.credentialsProvider == null) {
-            this.credentialsProvider = new BasicCredentialsProvider();
+        if (this.credentialsStore == null) {
+            this.credentialsStore = new BasicCredentialsProvider();
         }
-        this.credentialsProvider.setCredentials(authScope, creds);
+        this.credentialsStore.setCredentials(authScope, creds);
         return this;
     }
 
@@ -207,8 +207,8 @@ public class Executor {
     }
 
     public Executor clearAuth() {
-        if (this.credentialsProvider != null) {
-            this.credentialsProvider.clear();
+        if (this.credentialsStore != null) {
+            this.credentialsStore.clear();
         }
         return this;
     }
@@ -248,8 +248,8 @@ public class Executor {
     public Response execute(
             final Request request) throws ClientProtocolException, IOException {
         final HttpClientContext localContext = HttpClientContext.create();
-        if (this.credentialsProvider != null) {
-            localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
+        if (this.credentialsStore != null) {
+            localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsStore);
         }
         if (this.authCache != null) {
             localContext.setAttribute(HttpClientContext.AUTH_CACHE, this.authCache);

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiCredentialsProvider.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiCredentialsProvider.java Sat Jun 27 10:50:38 2015
@@ -31,7 +31,7 @@ import java.util.Map;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.osgi.services.ProxyConfiguration;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -39,7 +39,7 @@ import org.osgi.framework.ServiceRegistr
 /**
  * @since 4.3
  */
-final class OSGiCredentialsProvider implements CredentialsProvider {
+final class OSGiCredentialsProvider implements CredentialsStore {
 
     private final BundleContext bundleContext;
 

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java Sat Jun 27 10:50:38 2015
@@ -29,12 +29,12 @@ package org.apache.http.impl.auth.win;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.util.Args;
 
 /**
- * {@link org.apache.http.client.CredentialsProvider} implementation that always returns
+ * {@link CredentialsStore} implementation that always returns
  * {@link org.apache.http.impl.auth.win.CurrentWindowsCredentials} instance to NTLM
  * and SPNego authentication challenges.
  * <p>
@@ -44,11 +44,11 @@ import org.apache.http.util.Args;
  * @since 4.4
  */
 @ThreadSafe
-public class WindowsCredentialsProvider implements CredentialsProvider {
+public class WindowsCredentialsProvider implements CredentialsStore {
 
-    private final CredentialsProvider provider;
+    private final CredentialsStore provider;
 
-    public WindowsCredentialsProvider(final CredentialsProvider provider) {
+    public WindowsCredentialsProvider(final CredentialsStore provider) {
         this.provider = Args.notNull(provider, "Credentials provider");
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java Sat Jun 27 10:50:38 2015
@@ -29,7 +29,7 @@ package org.apache.http.impl.client;
 import java.util.Locale;
 
 import org.apache.http.auth.AuthSchemeProvider;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.config.Registry;
 import org.apache.http.config.RegistryBuilder;

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java Sat Jun 27 10:50:38 2015
@@ -28,10 +28,6 @@ package org.apache.http.impl.auth.win;
 
 import java.io.IOException;
 
-import com.sun.jna.platform.win32.Sspi.CtxtHandle;
-import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
-import com.sun.jna.platform.win32.Win32Exception;
-import com.sun.jna.platform.win32.WinError;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -40,7 +36,7 @@ import org.apache.http.HttpStatus;
 import org.apache.http.auth.AUTH;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -59,6 +55,11 @@ import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.sun.jna.platform.win32.Sspi.CtxtHandle;
+import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
+import com.sun.jna.platform.win32.Win32Exception;
+import com.sun.jna.platform.win32.WinError;
+
 /**
  * Unit tests for Windows negotiate authentication.
  */

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java Sat Jun 27 10:50:38 2015
@@ -28,7 +28,6 @@ package org.apache.http.examples.client;
 
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.BasicCredentialsProvider;
@@ -43,7 +42,7 @@ import org.apache.http.util.EntityUtils;
 public class ClientAuthentication {
 
     public static void main(String[] args) throws Exception {
-        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+        BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
         credsProvider.setCredentials(
                 new AuthScope("localhost", 443),
                 new UsernamePasswordCredentials("username", "password"));

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java Sat Jun 27 10:50:38 2015
@@ -41,8 +41,8 @@ import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.ParseException;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.config.CookieSpecs;
 import org.apache.http.client.config.RequestConfig;

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java Sat Jun 27 10:50:38 2015
@@ -30,7 +30,6 @@ import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.AuthCache;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
@@ -53,7 +52,7 @@ public class ClientPreemptiveBasicAuthen
 
     public static void main(String[] args) throws Exception {
         HttpHost target = new HttpHost("localhost", 80, "http");
-        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+        BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
         credsProvider.setCredentials(
                 new AuthScope(target.getHostName(), target.getPort()),
                 new UsernamePasswordCredentials("username", "password"));

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java Sat Jun 27 10:50:38 2015
@@ -30,7 +30,6 @@ import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.AuthCache;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
@@ -54,7 +53,7 @@ public class ClientPreemptiveDigestAuthe
 
     public static void main(String[] args) throws Exception {
         HttpHost target = new HttpHost("localhost", 80, "http");
-        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+        BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
         credsProvider.setCredentials(
                 new AuthScope(target.getHostName(), target.getPort()),
                 new UsernamePasswordCredentials("username", "password"));

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientProxyAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientProxyAuthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientProxyAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientProxyAuthentication.java Sat Jun 27 10:50:38 2015
@@ -29,7 +29,6 @@ package org.apache.http.examples.client;
 import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -45,7 +44,7 @@ import org.apache.http.util.EntityUtils;
 public class ClientProxyAuthentication {
 
     public static void main(String[] args) throws Exception {
-        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+        BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
         credsProvider.setCredentials(
                 new AuthScope("localhost", 8080),
                 new UsernamePasswordCredentials("username", "password"));

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/CredentialsProvider.java (from r1687907, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/CredentialsProvider.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/CredentialsProvider.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java&r1=1687907&r2=1687908&rev=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/CredentialsProvider.java Sat Jun 27 10:50:38 2015
@@ -24,14 +24,10 @@
  * <http://www.apache.org/>.
  *
  */
-package org.apache.http.client;
-
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.Credentials;
+package org.apache.http.auth;
 
 /**
- * Abstract credentials provider that maintains a collection of user
- * credentials.
+ * Provider of authentication credentials.
  * <p>
  * Implementations of this interface must be thread-safe. Access to shared
  * data must be synchronized as methods of this interface may be executed
@@ -42,30 +38,12 @@ import org.apache.http.auth.Credentials;
 public interface CredentialsProvider {
 
     /**
-     * Sets the {@link Credentials credentials} for the given authentication
-     * scope. Any previous credentials for the given scope will be overwritten.
-     *
-     * @param authscope the {@link AuthScope authentication scope}
-     * @param credentials the authentication {@link Credentials credentials}
-     * for the given scope.
-     *
-     * @see #getCredentials(AuthScope)
-     */
-    void setCredentials(AuthScope authscope, Credentials credentials);
-
-    /**
-     * Get the {@link Credentials credentials} for the given authentication scope.
+     * Returns {@link Credentials credentials} for the given authentication scope,
+     * if available.
      *
      * @param authscope the {@link AuthScope authentication scope}
      * @return the credentials
-     *
-     * @see #setCredentials(AuthScope, Credentials)
      */
     Credentials getCredentials(AuthScope authscope);
 
-    /**
-     * Clears all credentials.
-     */
-    void clear();
-
 }

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java (from r1687907, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java&r1=1687907&r2=1687908&rev=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java Sat Jun 27 10:50:38 2015
@@ -28,10 +28,10 @@ package org.apache.http.client;
 
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 
 /**
- * Abstract credentials provider that maintains a collection of user
- * credentials.
+ * Abstract store of authentication credentials.
  * <p>
  * Implementations of this interface must be thread-safe. Access to shared
  * data must be synchronized as methods of this interface may be executed
@@ -39,7 +39,7 @@ import org.apache.http.auth.Credentials;
  *
  * @since 4.0
  */
-public interface CredentialsProvider {
+public interface CredentialsStore extends CredentialsProvider {
 
     /**
      * Sets the {@link Credentials credentials} for the given authentication
@@ -54,16 +54,6 @@ public interface CredentialsProvider {
     void setCredentials(AuthScope authscope, Credentials credentials);
 
     /**
-     * Get the {@link Credentials credentials} for the given authentication scope.
-     *
-     * @param authscope the {@link AuthScope authentication scope}
-     * @return the credentials
-     *
-     * @see #setCredentials(AuthScope, Credentials)
-     */
-    Credentials getCredentials(AuthScope authscope);
-
-    /**
      * Clears all credentials.
      */
     void clear();

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/CredentialsStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java Sat Jun 27 10:50:38 2015
@@ -33,9 +33,9 @@ import java.util.List;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthState;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.config.Lookup;
 import org.apache.http.conn.routing.HttpRoute;
@@ -94,7 +94,7 @@ public class HttpClientContext extends H
     public static final String COOKIE_STORE          = "http.cookie-store";
 
     /**
-     * Attribute name of a {@link org.apache.http.client.CredentialsProvider}
+     * Attribute name of a {@link CredentialsProvider}
      * object that represents the actual credentials provider.
      */
     public static final String CREDS_PROVIDER        = "http.auth.credentials-provider";

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java Sat Jun 27 10:50:38 2015
@@ -41,8 +41,8 @@ import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.AuthCache;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.conn.routing.RouteInfo;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.Args;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java Sat Jun 27 10:50:38 2015
@@ -49,10 +49,10 @@ import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.MalformedChallengeException;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.AuthenticationStrategy;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.protocol.HttpClientContext;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java Sat Jun 27 10:50:38 2015
@@ -32,16 +32,16 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.util.Args;
 
 /**
- * Default implementation of {@link CredentialsProvider}.
+ * Default implementation of {@link CredentialsStore}.
  *
  * @since 4.0
  */
 @ThreadSafe
-public class BasicCredentialsProvider implements CredentialsProvider {
+public class BasicCredentialsProvider implements CredentialsStore {
 
     private final ConcurrentHashMap<AuthScope, Credentials> credMap;
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java Sat Jun 27 10:50:38 2015
@@ -49,11 +49,11 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.auth.AuthSchemeProvider;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.AuthenticationStrategy;
 import org.apache.http.client.BackoffManager;
 import org.apache.http.client.ConnectionBackoffStrategy;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.client.RedirectStrategy;
 import org.apache.http.client.ServiceUnavailableRetryStrategy;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java Sat Jun 27 10:50:38 2015
@@ -39,9 +39,9 @@ import org.apache.http.HttpRequest;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthState;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.Configurable;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java Sat Jun 27 10:50:38 2015
@@ -38,18 +38,18 @@ import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.NTCredentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.util.Args;
 
 /**
- * Implementation of {@link CredentialsProvider} backed by standard
+ * Implementation of {@link CredentialsStore} backed by standard
  * JRE {@link Authenticator}.
  *
  * @since 4.3
  */
 @ThreadSafe
-public class SystemDefaultCredentialsProvider implements CredentialsProvider {
+public class SystemDefaultCredentialsProvider implements CredentialsStore {
 
     private static final Map<String, String> SCHEME_MAP;
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java Sat Jun 27 10:50:38 2015
@@ -39,8 +39,9 @@ import org.apache.http.HttpRequest;
 import org.apache.http.ProtocolException;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.CredentialsStore;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.methods.HttpRequestWrapper;
@@ -48,7 +49,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.utils.URIUtils;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.protocol.HttpCoreContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.util.Args;
@@ -142,14 +142,12 @@ public class ProtocolExec implements Cli
         if (uri != null) {
             final String userinfo = uri.getUserInfo();
             if (userinfo != null) {
-                CredentialsProvider credsProvider = context.getCredentialsProvider();
-                if (credsProvider == null) {
-                    credsProvider = new BasicCredentialsProvider();
-                    context.setCredentialsProvider(credsProvider);
+                final CredentialsProvider credsProvider = context.getCredentialsProvider();
+                if (credsProvider instanceof CredentialsStore) {
+                    ((CredentialsStore) credsProvider).setCredentials(
+                            new AuthScope(target),
+                            new UsernamePasswordCredentials(userinfo));
                 }
-                credsProvider.setCredentials(
-                        new AuthScope(target),
-                        new UsernamePasswordCredentials(userinfo));
             }
         }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java Sat Jun 27 10:50:38 2015
@@ -41,9 +41,9 @@ import org.apache.http.auth.AuthOption;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.AuthCache;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.protocol.HttpClientContext;
@@ -227,7 +227,7 @@ public class TestAuthenticationStrategy
             .register("digest", new DigestSchemeFactory()).build();
         context.setAuthSchemeRegistry(authSchemeRegistry);
 
-        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         credentialsProvider.setCredentials(new AuthScope("somehost", 80, "realm2"),
                 new UsernamePasswordCredentials("user", "pwd"));
         context.setCredentialsProvider(credentialsProvider);
@@ -256,7 +256,7 @@ public class TestAuthenticationStrategy
             .register("digest", new DigestSchemeFactory()).build();
         context.setAuthSchemeRegistry(authSchemeRegistry);
 
-        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         credentialsProvider.setCredentials(new AuthScope("somehost", 80),
                 new UsernamePasswordCredentials("user", "pwd"));
         context.setCredentialsProvider(credentialsProvider);
@@ -291,7 +291,7 @@ public class TestAuthenticationStrategy
         context.setAuthSchemeRegistry(authSchemeRegistry);
         context.setRequestConfig(config);
 
-        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         credentialsProvider.setCredentials(new AuthScope("somehost", 80),
                 new UsernamePasswordCredentials("user", "pwd"));
         context.setCredentialsProvider(credentialsProvider);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestInternalHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestInternalHttpClient.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestInternalHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestInternalHttpClient.java Sat Jun 27 10:50:38 2015
@@ -33,9 +33,9 @@ import java.util.Arrays;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthSchemeProvider;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpRequestWrapper;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java Sat Jun 27 10:50:38 2015
@@ -41,10 +41,10 @@ import org.apache.http.HttpStatus;
 import org.apache.http.auth.AUTH;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.NonRepeatableRequestException;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpGet;
@@ -150,19 +150,11 @@ public class TestClientAuthentication ex
         }
 
         @Override
-        public void clear() {
-        }
-
-        @Override
         public Credentials getCredentials(final AuthScope authscope) {
             this.authscope = authscope;
             return this.creds;
         }
 
-        @Override
-        public void setCredentials(final AuthScope authscope, final Credentials credentials) {
-        }
-
         public AuthScope getAuthScope() {
             return this.authscope;
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java Sat Jun 27 10:50:38 2015
@@ -39,8 +39,8 @@ import org.apache.http.HttpStatus;
 import org.apache.http.auth.AUTH;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.entity.StringEntity;
@@ -118,19 +118,11 @@ public class TestClientAuthenticationFal
         }
 
         @Override
-        public void clear() {
-        }
-
-        @Override
         public Credentials getCredentials(final AuthScope authscope) {
             this.authscope = authscope;
             return this.creds;
         }
 
-        @Override
-        public void setCredentials(final AuthScope authscope, final Credentials credentials) {
-        }
-
         public AuthScope getAuthScope() {
             return this.authscope;
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java Sat Jun 27 10:50:38 2015
@@ -43,8 +43,8 @@ import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
@@ -134,23 +134,11 @@ public class TestClientReauthentication
         }
 
         @Override
-        public void clear() {
-        }
-
-        @Override
         public Credentials getCredentials(final AuthScope authscope) {
             this.authscope = authscope;
             return this.creds;
         }
 
-        @Override
-        public void setCredentials(final AuthScope authscope, final Credentials credentials) {
-        }
-
-        public AuthScope getAuthScope() {
-            return this.authscope;
-        }
-
     }
 
     @Test

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java Sat Jun 27 10:50:38 2015
@@ -38,7 +38,6 @@ import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.config.Registry;
@@ -155,7 +154,7 @@ public class TestSPNegoScheme extends Lo
         final HttpHost target = start();
 
         final AuthSchemeProvider nsf = new NegotiateSchemeProviderWithMockGssManager();
-        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         final Credentials use_jaas_creds = new UseJaasCredentials();
         credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds);
 
@@ -186,7 +185,7 @@ public class TestSPNegoScheme extends Lo
 
         final AuthSchemeProvider nsf = new NegotiateSchemeProviderWithMockGssManager();
 
-        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         final Credentials use_jaas_creds = new UseJaasCredentials();
         credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds);
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java?rev=1687908&r1=1687907&r2=1687908&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java Sat Jun 27 10:50:38 2015
@@ -33,13 +33,14 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
-import org.apache.http.client.CredentialsProvider;
+import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
+import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -185,11 +186,11 @@ public class TestProtocolExec {
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
                 new HttpGet("http://somefella:secret@bar/test"));
         final HttpClientContext context = HttpClientContext.create();
+        context.setCredentialsProvider(new BasicCredentialsProvider());
         protocolExec.execute(route, request, context, execAware);
         Assert.assertEquals(new URI("/test"), request.getURI());
         Assert.assertEquals(new HttpHost("bar", -1), context.getTargetHost());
         final CredentialsProvider credentialsProvider = context.getCredentialsProvider();
-        Assert.assertNotNull(credentialsProvider);
         final Credentials creds = credentialsProvider.getCredentials(new AuthScope("bar", -1, null));
         Assert.assertNotNull(creds);
         Assert.assertEquals("somefella", creds.getUserPrincipal().getName());



Mime
View raw message