HttpServerInitializer extends ChannelInitializer<SocketChannel> { @Override protected void initChannel(final SocketChannel socketChannel) { ChannelPipeline channelPipeline = socketChannel.pipeline(); channelPipeline.addLast(new HttpServerCodec()); channelPipeline.addLast(new HttpObjectAggregator(65536)); channelPipeline.addLast(new HttpServerHandler()); }    }
@Test public void assertInitChannel() { HttpServerInitializer httpServerInitializer = new HttpServerInitializer(); httpServerInitializer.initChannel(socketChannel); verify(channelPipeline, times(3)).addLast(any(ChannelHandler.class)); }