diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java index 5f9072557..8103d60c0 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java @@ -579,8 +579,8 @@ public class CachingExec implements ClientExecChain { final CloseableHttpResponse backendResponse = backend.execute(route, request, context, execAware); try { backendResponse.addHeader("Via", generateViaHeader(backendResponse)); - return handleBackendResponse(route, request, context, execAware, - requestDate, getCurrentDate(), backendResponse); + return handleBackendResponse(request, context, requestDate, getCurrentDate(), + backendResponse); } catch (final IOException ex) { backendResponse.close(); throw ex; @@ -629,9 +629,8 @@ public class CachingExec implements ClientExecChain { backendResponse.addHeader("Via", generateViaHeader(backendResponse)); if (backendResponse.getStatusLine().getStatusCode() != HttpStatus.SC_NOT_MODIFIED) { - return handleBackendResponse( - route, request, context, execAware, - requestDate, responseDate, backendResponse); + return handleBackendResponse(request, context, requestDate, responseDate, + backendResponse); } final Header resultEtagHeader = backendResponse.getFirstHeader(HeaderConstants.ETAG); @@ -784,9 +783,8 @@ public class CachingExec implements ClientExecChain { backendResponse.close(); } } - return handleBackendResponse( - route, conditionalRequest, context, execAware, - requestDate, responseDate, backendResponse); + return handleBackendResponse(conditionalRequest, context, requestDate, responseDate, + backendResponse); } private boolean staleIfErrorAppliesTo(final int statusCode) { @@ -797,10 +795,8 @@ public class CachingExec implements ClientExecChain { } CloseableHttpResponse handleBackendResponse( - final HttpRoute route, final HttpRequestWrapper request, final HttpClientContext context, - final HttpExecutionAware execAware, final Date requestDate, final Date responseDate, final CloseableHttpResponse backendResponse) throws IOException { diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java index b7e61c96f..018d141e9 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java @@ -262,10 +262,8 @@ public class TestCachingExec extends TestCachingExecChain { backendExpectsRequestAndReturn(validate, originResponse); getCurrentDateReturns(responseDate); expect(impl.handleBackendResponse( - eq(route), same(validate), same(context), - (HttpExecutionAware) isNull(), eq(requestDate), eq(responseDate), same(originResponse))).andReturn(finalResponse); @@ -404,10 +402,8 @@ public class TestCachingExec extends TestCachingExecChain { throws IOException { expect( impl.handleBackendResponse( - isA(HttpRoute.class), same(request), isA(HttpClientContext.class), - (HttpExecutionAware) isNull(), isA(Date.class), isA(Date.class), isA(CloseableHttpResponse.class))).andReturn( diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java index 99b78b8ca..f62aee20f 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java @@ -106,7 +106,7 @@ public class TestHttpCacheJiraNumber1147 { EasyMock.expect(backend.execute( EasyMock.eq(route), EasyMock.isA(HttpRequestWrapper.class), - EasyMock.same(context), + EasyMock.isA(HttpClientContext.class), EasyMock.isNull())).andReturn(Proxies.enhanceResponse(response)); EasyMock.replay(backend); @@ -125,7 +125,7 @@ public class TestHttpCacheJiraNumber1147 { EasyMock.expect(backend.execute( EasyMock.eq(route), EasyMock.isA(HttpRequestWrapper.class), - EasyMock.same(context), + EasyMock.isA(HttpClientContext.class), EasyMock.isNull())).andReturn(Proxies.enhanceResponse(response)); EasyMock.replay(backend);