### Question:
DssWebSocketSslChannelInitializer extends DssWebSocketChannelInitializer { @Override protected void initChannel(SocketChannel ch) throws Exception { logger.info("Try to initChannel"); final ChannelPipeline p = ch.pipeline(); p.addLast(sslCtx.newHandler(ch.alloc())); p.addLast(new HttpServerCodec()); p.addLast(new HttpObjectAggregator(65536)); p.addLast(new DssHttpRequestHandler(WEBSOCKET_PATH)); p.addLast(new DssWebSocketHandler()); } DssWebSocketSslChannelInitializer(SslContext sslCtx);   }### Answer:
@Test void initChannel() throws Exception { Mockito .when(socketChannel.pipeline()) .thenReturn(channelPipeline); Mockito .when(channelPipeline.addLast(any())) .thenReturn(channelPipeline); Mockito .when(channelPipeline.first()) .thenReturn(new SslHandler(sslEngine)); Mockito .when(channelPipeline.get(HttpServerCodec.class)) .thenReturn(new HttpServerCodec()); Mockito .when(channelPipeline.get(HttpObjectAggregator.class)) .thenReturn(new HttpObjectAggregator(65536)); Mockito .when(channelPipeline.get(DssHttpRequestHandler.class)) .thenReturn(new DssHttpRequestHandler("/websocket")); Mockito .when(channelPipeline.last()) .thenReturn(new DssWebSocketHandler()); final DssWebSocketSslChannelInitializer dssWebSocketSslChannelInitializerTest = Mockito.mock(DssWebSocketSslChannelInitializer.class); dssWebSocketSslChannelInitializerTest.initChannel(socketChannel); final ChannelPipeline p = socketChannel.pipeline(); assertEquals(SslHandler.class, p.first().getClass()); assertEquals(HttpServerCodec.class, p.get(HttpServerCodec.class).getClass()); assertEquals(HttpObjectAggregator.class, p.get(HttpObjectAggregator.class).getClass()); assertEquals(DssHttpRequestHandler.class, p.get(DssHttpRequestHandler.class).getClass()); assertEquals(DssWebSocketHandler.class, p.last().getClass()); }