diff --git a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java index 6f93890a1..736ac798f 100644 --- a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java +++ b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java @@ -31,6 +31,7 @@ import junit.framework.Assert; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; +import org.apache.http.auth.AuthProtocolState; import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthState; import org.apache.http.auth.Credentials; @@ -230,10 +231,12 @@ public class TestRequestAuthCache { context.setAttribute(ClientContext.AUTH_CACHE, authCache); + this.targetState.setState(AuthProtocolState.CHALLENGED); this.targetState.setAuthScheme(new BasicScheme()); this.targetState.setCredentials(new UsernamePasswordCredentials("user3", "secret3")); this.proxyState.setAuthScheme(new BasicScheme()); this.proxyState.setCredentials(new UsernamePasswordCredentials("user4", "secret4")); + this.proxyState.setState(AuthProtocolState.CHALLENGED); HttpRequestInterceptor interceptor = new RequestAuthCache(); interceptor.process(request, context); diff --git a/httpclient/src/test/java/org/apache/http/impl/client/TestClientReauthentication.java b/httpclient/src/test/java/org/apache/http/impl/client/TestClientReauthentication.java index 883a3e294..c57bc9e46 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/TestClientReauthentication.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/TestClientReauthentication.java @@ -151,7 +151,6 @@ public class TestClientReauthentication extends BasicServerTestBase { HttpContext context = new BasicHttpContext(); for (int i = 0; i < 10; i++) { HttpGet httpget = new HttpGet("/"); - System.out.println("count " + i); HttpResponse response = this.httpclient.execute(getServerHttp(), httpget, context); HttpEntity entity = response.getEntity(); Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());