### Question:
BoltProtocolV1 implements BoltProtocol { @Override public void install() { ChannelPipeline pipeline = channel.rawChannel().pipeline(); pipeline.addLast( new ChunkDecoder() ); pipeline.addLast( new MessageAccumulator() ); pipeline.addLast( new MessageDecoder( neo4jPack, messageReader, logging ) ); pipeline.addLast( new HouseKeeper( connection, logging.getInternalLog( HouseKeeper.class ) ) ); } BoltProtocolV1( BoltChannel channel, BoltConnectionFactory connectionFactory, BoltStateMachineFactory stateMachineFactory, LogService logging ); @Override void install(); @Override long version(); static final long VERSION; }### Answer:
@Test public void shouldInstallChannelHandlersInCorrectOrder() throws Throwable { BoltChannel boltChannel = newBoltChannel( channel ); BoltConnectionFactory connectionFactory = mock( BoltConnectionFactory.class ); when( connectionFactory.newConnection( eq( boltChannel ), any() ) ).thenReturn( mock( BoltConnection.class ) ); BoltProtocol boltProtocol = new BoltProtocolV1( boltChannel, connectionFactory, mock( BoltStateMachineFactory.class ), NullLogService.getInstance() ); boltProtocol.install(); Iterator<Map.Entry<String,ChannelHandler>> handlers = channel.pipeline().iterator(); assertThat( handlers.next().getValue(), instanceOf( ChunkDecoder.class ) ); assertThat( handlers.next().getValue(), instanceOf( MessageAccumulator.class ) ); assertThat( handlers.next().getValue(), instanceOf( MessageDecoder.class ) ); assertThat( handlers.next().getValue(), instanceOf( HouseKeeper.class ) ); assertFalse( handlers.hasNext() ); }