@Test
public void testWarning110IsAddedToStaleResponses()
throws Exception {
final Date now = new Date();
final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
final HttpResponse resp1 = HttpTestUtils.make200Response();
resp1.setHeader("Date", DateUtils.formatDate(tenSecondsAgo));
resp1.setHeader("Cache-Control","max-age=5");
resp1.setHeader("Etag","\"etag\"");
backendExpectsAnyRequestAndReturn(resp1);
final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
req2.setHeader("Cache-Control","max-stale=60");
final HttpResponse resp2 = HttpTestUtils.make200Response();
final Capture<HttpRequestWrapper> cap = new Capture<HttpRequestWrapper>();
EasyMock.expect(
mockBackend.execute(