@@ -67,6 +67,7 @@ void testCloseChannelIfServerIsShutdown() {
6767                        new  SslHelper (null , false ),
6868                        r  -> r .response ().end (),
6969                        null ,
70+                         null ,
7071                        null );
7172        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
7273        assertFalse (channel .isActive ());
@@ -81,6 +82,7 @@ void testApplyWriteBufferHighWaterMark() {
8182                        new  SslHelper (null , false ),
8283                        r  -> r .response ().end (),
8384                        null ,
85+                         null ,
8486                        null );
8587        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
8688        assertEquals (WriteBufferWaterMark .DEFAULT .high () + 1 ,
@@ -96,6 +98,7 @@ void testApplyWriteBufferLowWaterMark() {
9698                        new  SslHelper (null , false ),
9799                        r  -> r .response ().end (),
98100                        null ,
101+                         null ,
99102                        null );
100103        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
101104        assertEquals (WriteBufferWaterMark .DEFAULT .low () - 1 ,
@@ -112,6 +115,7 @@ void testApplyWriteBufferWaterMark() {
112115                        new  SslHelper (null , false ),
113116                        r  -> r .response ().end (),
114117                        null ,
118+                         null ,
115119                        null );
116120        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
117121        assertEquals (WriteBufferWaterMark .DEFAULT .low () - 1 ,
@@ -129,6 +133,7 @@ void testHAProxyDetectorInitialization() {
129133                        new  SslHelper (null , false ),
130134                        r  -> r .response ().end (),
131135                        null ,
136+                         null ,
132137                        null );
133138        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
134139        assertNotNull (channel .pipeline ().get (HAProxyDetector .class ));
@@ -144,6 +149,7 @@ void testHAProxyDecoderInitialization() {
144149                        new  SslHelper (null , false ),
145150                        r  -> r .response ().end (),
146151                        null ,
152+                         null ,
147153                        null );
148154        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
149155        assertNotNull (channel .pipeline ().get (HAProxyMessageDecoder .class ));
@@ -162,14 +168,16 @@ void testHAProxyOffInitialization() {
162168                        new  SslHelper (null , false ),
163169                        r  -> r .response ().end (),
164170                        null ,
171+                         null ,
165172                        null );
166173        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
167174        assertNull (channel .pipeline ().get (HAProxyMessageDecoder .class ));
168175        assertNull (channel .pipeline ().get (HAProxyMessageHandler .class ));
169176    }
170177
171178    @ Test 
172-     void  testChannelActiveAndInactiveListener () {
179+     void  testChannelInitAndActiveAndInactiveListener () {
180+         final  AtomicBoolean  init  = new  AtomicBoolean ();
173181        final  AtomicBoolean  active  = new  AtomicBoolean ();
174182        final  AtomicBoolean  inActive  = new  AtomicBoolean ();
175183        final  ServerRuntime  runtime  = Helper .serverRuntime (ServerOptionsConfigure .newOpts ()
@@ -179,11 +187,13 @@ void testChannelActiveAndInactiveListener() {
179187                new  HttpServerChannelInitializr (runtime ,
180188                        new  SslHelper (null , false ),
181189                        r  -> r .response ().end (),
182-                         ctx  -> active .set (true ),
190+                         c  -> init .set (true ),
191+                         c  -> active .set (true ),
183192                        c  -> inActive .set (true ));
184193
185194        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
186195
196+         assertTrue (init .get ());
187197        assertTrue (active .get ());
188198        assertFalse (inActive .get ());
189199
@@ -203,6 +213,7 @@ void testChannelActiveAndInactiveListener() {
203213
204214    @ Test 
205215    void  testErrorOccurredInConnectionHandlerShouldBeIgnored () {
216+         final  AtomicBoolean  init  = new  AtomicBoolean ();
206217        final  AtomicBoolean  active  = new  AtomicBoolean ();
207218        final  AtomicBoolean  inActive  = new  AtomicBoolean ();
208219        final  ServerRuntime  runtime  = Helper .serverRuntime (ServerOptionsConfigure .newOpts ()
@@ -212,7 +223,11 @@ void testErrorOccurredInConnectionHandlerShouldBeIgnored() {
212223                new  HttpServerChannelInitializr (runtime ,
213224                        new  SslHelper (null , false ),
214225                        r  -> r .response ().end (),
215-                         ctx  -> {
226+                         c  -> {
227+                             init .set (true );
228+                             ExceptionUtils .throwException (new  IllegalStateException ());
229+                         },
230+                         c  -> {
216231                            active .set (true );
217232                            ExceptionUtils .throwException (new  IllegalStateException ());
218233                        },
@@ -223,6 +238,7 @@ void testErrorOccurredInConnectionHandlerShouldBeIgnored() {
223238
224239        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
225240
241+         assertTrue (init .get ());
226242        assertTrue (active .get ());
227243        assertFalse (inActive .get ());
228244        channel .close ();
@@ -426,6 +442,7 @@ private static void testUnsupportedUpgradeProtocol(boolean logging,
426442                        new  SslHelper (null , false ),
427443                        r  -> r .response ().end (),
428444                        null ,
445+                         null ,
429446                        null );
430447
431448        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -502,6 +519,7 @@ private static void testUpgradeError(boolean logging,
502519                            });
503520                        },
504521                        null ,
522+                         null ,
505523                        null );
506524
507525        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -573,6 +591,7 @@ private static void testUpgrade(boolean logging,
573591                        new  SslHelper (null , false ),
574592                        r  -> r .response ().end (),
575593                        null ,
594+                         null ,
576595                        null );
577596
578597        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -637,6 +656,7 @@ private static void testHttp1HandlerInitialization(boolean logging,
637656                        new  SslHelper (null , false ),
638657                        r  -> r .response ().end (),
639658                        null ,
659+                         null ,
640660                        null );
641661
642662        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -681,6 +701,7 @@ private static void testSslDetectFailedWithHttp2Disabled(boolean logging,
681701                        new  SslHelper (runtime .options ().getSsl (), false ),
682702                        r  -> r .response ().end (),
683703                        null ,
704+                         null ,
684705                        null );
685706
686707        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -737,6 +758,7 @@ private static void testSslDetectFailedWithHttp2Enabled(boolean logging,
737758                        new  SslHelper (runtime .options ().getSsl (), false ),
738759                        r  -> r .response ().end (),
739760                        null ,
761+                         null ,
740762                        null );
741763
742764        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -805,6 +827,7 @@ private static void testH1HandlerInitializationAfterH2cDetector(boolean logging,
805827                        new  SslHelper (null , false ),
806828                        r  -> r .response ().end (),
807829                        null ,
830+                         null ,
808831                        null );
809832
810833        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
@@ -869,6 +892,7 @@ private static void testH2cHandlerInitializationAfterH2cDetector(boolean logging
869892                        new  SslHelper (null , false ),
870893                        r  -> r .response ().end (),
871894                        null ,
895+                         null ,
872896                        null );
873897
874898        final  EmbeddedChannel  channel  = new  EmbeddedChannel (initializr );
0 commit comments