Update `ReactiveWebServerApplicationContext` so that the `HttpHandler`
bean is not longer created from `onRefresh`, but is instead created
only when the server starts.
Prior to this commit, the WebFlux hander would cause early
initialization of several beans, including Jackson Modules.
Closes gh-14666
@ -80,11 +85,23 @@ public class AnnotationConfigReactiveWebServerApplicationContextTests {
@@ -80,11 +85,23 @@ public class AnnotationConfigReactiveWebServerApplicationContextTests {
@ -107,4 +124,54 @@ public class AnnotationConfigReactiveWebServerApplicationContextTests {
@@ -107,4 +124,54 @@ public class AnnotationConfigReactiveWebServerApplicationContextTests {
}
@Configuration
publicstaticclassInitializationTestConfig{
privatestaticbooleanaddedListener;
@Bean
publicReactiveWebServerFactorywebServerFactory(){
returnnewMockReactiveWebServerFactory();
}
@Bean
publicHttpHandlerhttpHander(){
if(!addedListener){
thrownewRuntimeException(
"Handlers should be added after listeners, we're being initialized too early!");