proxyServlet = new ProxyServlet()
{
@Override
protected ContentProvider proxyRequestContent(Request proxyRequest, HttpServletRequest request) throws IOException
{
return new BytesContentProvider(content)
{
@Override
public long getLength()
{
// Increase the content length to trigger the test condition.
return content.length + 1;
}
};
}
};
}
prepareProxy();
prepareServer(new EchoHttpServlet());
long idleTimeout = 1000;
serverConnector.setIdleTimeout(idleTimeout);
ContentResponse response = client.newRequest("localhost", serverConnector.getLocalPort())
.content(new BytesContentProvider(content))
.send();
Assert.assertEquals(500, response.getStatus());
}