Previously, when health probes were enabled, the post-processor of
AutoConfiguredHealthEndpointGroups resulted in the bean no longer
implementing AdditionalPathMapper. This then caused a
ClassCastException when working with AdditionalPathMapper beans
in EndpointRequest's additional path mapping support.
This commit updates the type returned by the post-processor to
implement both HealthEndpointGroups and AdditionalPathMapper, as
AutoConfiguredHealthEndpointGroups does. Its implementation of
getAdditionalPaths produces a result that combines both the
additional paths of the original HealthEndpointGroups bean and its
own additional paths for the probes.
Fixes gh-44052
Previously, customization was performed in two places:
1. By customizers defined in the reactive and servlet web servlet
factory auto-configuration
- ServletWebServerFactoryAutoConfiguration
- ReactiveWebServerFactoryAutoConfiguration
2. By a ManagementWebServerFactoryCustomizer that delegates to
customizers of certain types found in the application context
hierarchy.
This led to some double customization as the customizers registered
by the auto-configuration classes were also found and called by the
ManagementWebServerFactoryCustomizer.
Additionally, the ManagementWebServerFactoryCustomizer would find
customizers from the parent context registered by
EmbeddedWebServerFactoryCustomizerAutoConfiguration.
This commit reworks the customization of the management web server
factory to remove the double customization.
ManagementWebServerFactoryCustomizer no longer delegates to
customizers that it finds in the context hierarchy. This
prevents the customizers defined in the reactive and servlet web
server factory auto-configuration classes from being called twice.
Additionally, EmbeddedWebServerFactoryCustomizerAutoConfiguration is
now registered in the child context so that its customizers continue
to be called when preparing the management context web server
factory.
Closes gh-44151