public class HopByHopHeaderFilterTest {
@Test
public void shouldNotForwardHopByHopHeaders() throws Exception {
// given
HttpRequest httpRequest = new HttpRequest();
httpRequest.withHeaders(
new Header("some_other_header"),
new Header("proxy-connection"),
new Header("connection"),
new Header("keep-alive"),
new Header("transfer-encoding"),
new Header("te"),
new Header("trailer"),
new Header("proxy-authorization"),
new Header("proxy-authenticate"),
new Header("upgrade")
);
// when
new HopByHopHeaderFilter().onRequest(httpRequest);
// then
assertEquals(httpRequest.getHeaders().size(), 1);
}