resp1.setHeader("Last-Modified", DateUtils.formatDate(oneHourAgo));
final byte[] bytes1 = new byte[128];
for (int i = 0; i < bytes1.length; i++) {
bytes1[i] = (byte) 1;
}
resp1.setEntity(new ByteArrayEntity(bytes1));
final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
req2.setHeader("Cache-Control", "no-cache");
req2.setHeader("Range", "bytes=0-50");
final Date inOneSecond = new Date(now.getTime() + 1000L);
final HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_PARTIAL_CONTENT,
"Partial Content");
resp2.setHeader("Date", DateUtils.formatDate(inOneSecond));
resp2.setHeader("Server", resp1.getFirstHeader("Server").getValue());
resp2.setHeader("Last-Modified", DateUtils.formatDate(now));
resp2.setHeader("Content-Range", "bytes 0-50/128");
final byte[] bytes2 = new byte[51];
for (int i = 0; i < bytes2.length; i++) {
bytes2[i] = (byte) 2;
}
resp2.setEntity(new ByteArrayEntity(bytes2));
final Date inTwoSeconds = new Date(now.getTime() + 2000L);
final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(
new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
final HttpResponse resp3 = HttpTestUtils.make200Response();
resp3.setHeader("Date", DateUtils.formatDate(inTwoSeconds));
resp3.setHeader("Cache-Control", "max-age=3600");
resp3.setHeader("ETag", "\"etag2\"");
final byte[] bytes3 = new byte[128];
for (int i = 0; i < bytes3.length; i++) {
bytes3[i] = (byte) 2;
}
resp3.setEntity(new ByteArrayEntity(bytes3));
EasyMock.expect(
mockBackend.execute(
EasyMock.isA(HttpRoute.class),
EasyMock.isA(HttpRequestWrapper.class),