diff --git a/module/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMapping.java b/module/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMapping.java index 9e6d62bb392..72bd7471a0b 100644 --- a/module/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMapping.java +++ b/module/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMapping.java @@ -555,6 +555,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi this.responseStatus = responseStatus; } + @Reflective Mono handle(ServerWebExchange exchange) { ServerHttpResponse response = exchange.getResponse(); response.setStatusCode(this.responseStatus); @@ -623,7 +624,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi @Override public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { this.reflectiveRegistrar.registerRuntimeHints(hints, WriteOperationHandler.class, - ReadOperationHandler.class); + ReadOperationHandler.class, CatchAllHandler.class); } } diff --git a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMappingTests.java b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMappingTests.java index 0b81c6272a6..1171854820a 100644 --- a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMappingTests.java +++ b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/actuate/endpoint/web/AbstractWebFluxEndpointHandlerMappingTests.java @@ -45,6 +45,10 @@ class AbstractWebFluxEndpointHandlerMappingTests { .onType(TypeReference .of("org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping.ReadOperationHandler"))) .accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.reflection() + .onType(TypeReference + .of("org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping.CatchAllHandler"))) + .accepts(runtimeHints); } } diff --git a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMapping.java b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMapping.java index b102879e893..19db92781a0 100644 --- a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMapping.java +++ b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMapping.java @@ -494,6 +494,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin this.responseStatus = responseStatus; } + @Reflective void handle(HttpServletResponse response) { response.setStatus(this.responseStatus.value()); } @@ -559,7 +560,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin @Override public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { - this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class); + this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class, CatchAllHandler.class); } } diff --git a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMappingTests.java b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMappingTests.java index c6a818cab55..c7398dbf853 100644 --- a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMappingTests.java +++ b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/endpoint/web/AbstractWebMvcEndpointHandlerMappingTests.java @@ -40,6 +40,10 @@ class AbstractWebMvcEndpointHandlerMappingTests { .onType(TypeReference .of("org.springframework.boot.webmvc.actuate.endpoint.web.AbstractWebMvcEndpointHandlerMapping.OperationHandler"))) .accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.reflection() + .onType(TypeReference + .of("org.springframework.boot.webmvc.actuate.endpoint.web.AbstractWebMvcEndpointHandlerMapping.CatchAllHandler"))) + .accepts(runtimeHints); } }