Search in sources :

Example 1 with DefaultAttributeMap

use of io.netty.util.DefaultAttributeMap in project zuul by Netflix.

the class StripUntrustedProxyHeadersHandlerTest method before.

@Before
public void before() {
    when(channelHandlerContext.channel()).thenReturn(channel);
    DefaultAttributeMap attributeMap = new DefaultAttributeMap();
    attributeMap.attr(ATTR_SSL_INFO).set(sslHandshakeInfo);
    when(channel.attr(any())).thenAnswer(arg -> attributeMap.attr((AttributeKey) arg.getArguments()[0]));
    headers = new DefaultHttpHeaders();
    when(msg.headers()).thenReturn(headers);
    headers.add(HttpHeaderNames.HOST, "netflix.com");
}
Also used : AttributeKey(io.netty.util.AttributeKey) DefaultHttpHeaders(io.netty.handler.codec.http.DefaultHttpHeaders) DefaultAttributeMap(io.netty.util.DefaultAttributeMap) Before(org.junit.Before)

Aggregations

DefaultHttpHeaders (io.netty.handler.codec.http.DefaultHttpHeaders)1 AttributeKey (io.netty.util.AttributeKey)1 DefaultAttributeMap (io.netty.util.DefaultAttributeMap)1 Before (org.junit.Before)1