spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.87k stars 40.61k forks source link

Evaluate if adding a @WebEndpointTest for testing custom actuator web points is now feasible #40574

Open philwebb opened 5 months ago

philwebb commented 5 months ago

See #11399 for background. The codebase has moved on quite bit since that issue was raised so we might be able to consider it.

philwebb commented 5 months ago

We think it's worth investigating this a little more, but it might be prudent to do so alongside #20290 since we expect some of the actuator core to change.

In the meantime, the following code should work for testing Spring MVC apps:

@ImportAutoConfiguration({EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, 
    BeansEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class})