ChannelPipelineBuilderImpl implements ChannelPipelineBuilder { @Override public void build( MessageFormat messageFormat, ChannelPipeline pipeline, Logging logging ) { pipeline.addLast( new ChunkDecoder( logging ) ); pipeline.addLast( new MessageDecoder() ); pipeline.addLast( new InboundMessageHandler( messageFormat, logging ) ); pipeline.addLast( OutboundMessageHandler.NAME, new OutboundMessageHandler( messageFormat, logging ) ); pipeline.addLast( new ChannelErrorHandler( logging ) ); }  @Override void build( MessageFormat messageFormat, ChannelPipeline pipeline, Logging logging );  }
@Test void shouldBuildPipeline() { EmbeddedChannel channel = new EmbeddedChannel(); ChannelAttributes.setMessageDispatcher( channel, new InboundMessageDispatcher( channel, DEV_NULL_LOGGING ) ); new ChannelPipelineBuilderImpl().build( new MessageFormatV3(), channel.pipeline(), DEV_NULL_LOGGING ); Iterator<Map.Entry<String,ChannelHandler>> iterator = channel.pipeline().iterator(); assertThat( iterator.next().getValue(), instanceOf( ChunkDecoder.class ) ); assertThat( iterator.next().getValue(), instanceOf( MessageDecoder.class ) ); assertThat( iterator.next().getValue(), instanceOf( InboundMessageHandler.class ) ); assertThat( iterator.next().getValue(), instanceOf( OutboundMessageHandler.class ) ); assertThat( iterator.next().getValue(), instanceOf( ChannelErrorHandler.class ) ); assertFalse( iterator.hasNext() ); }