Java 类io.netty.util.DefaultAttributeMap 实例源码

项目:yarpc-java    文件:TransportRequestDecoderTest.java   
private static Channel mockChannelWithAttributes() {
  Channel channel = mock(Channel.class);
  AttributeMap attrs = new DefaultAttributeMap();
  when(channel.attr(any())).then(invocation -> attrs.attr(invocation.getArgument(0)));
  return channel;
}