@Test void initChannel() throws Exception { Mockito .when(socketChannel.pipeline()) .thenReturn(channelPipeline); Mockito .when(channelPipeline.addLast(any())) .thenReturn(channelPipeline); Mockito .when(channelPipeline.first()) .thenReturn(new HttpRequestDecoder()); final DssRestChannelInitializer dssRestChannelInitializer = Mockito.mock(DssRestChannelInitializer.class); dssRestChannelInitializer.create(); dssRestChannelInitializer.initChannel(socketChannel); final ChannelPipeline p = socketChannel.pipeline(); assertEquals(HttpRequestDecoder.class, p.first().getClass()); }
@Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); addHandler(p); }
DssRestChannelInitializer extends ChannelInitializer<SocketChannel> implements DssChannelInitializer<DssRestChannelInitializerCommand> { @Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); addHandler(p); } }
DssRestChannelInitializer extends ChannelInitializer<SocketChannel> implements DssChannelInitializer<DssRestChannelInitializerCommand> { @Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); addHandler(p); } DssRestChannelInitializer(List<DssRestActorService> serviceList); }
DssRestChannelInitializer extends ChannelInitializer<SocketChannel> implements DssChannelInitializer<DssRestChannelInitializerCommand> { @Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); addHandler(p); } DssRestChannelInitializer(List<DssRestActorService> serviceList); @Override Behavior<DssRestChannelInitializerCommand> create(); }
DssRestChannelInitializer extends ChannelInitializer<SocketChannel> implements DssChannelInitializer<DssRestChannelInitializerCommand> { @Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); addHandler(p); } DssRestChannelInitializer(List<DssRestActorService> serviceList); @Override Behavior<DssRestChannelInitializerCommand> create();  }