From a9469d9c8eb8a2a3b8bd60365a4a08f69ec1fce8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 23 Oct 2023 18:07:38 +0100 Subject: [PATCH] Adapt to changes in Framework's internals See gh-37995 --- .../web/reactive/error/AbstractErrorWebExceptionHandler.java | 3 +-- .../reactive/error/DefaultErrorWebExceptionHandlerTests.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index 11c1bf536cc..8b7daafd5c9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -62,13 +62,12 @@ import org.springframework.web.util.HtmlUtils; public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExceptionHandler, InitializingBean { /** - * Currently duplicated from Spring WebFlux HttpWebHandlerAdapter. + * Currently duplicated from Spring Web's DisconnectedClientHelper. */ private static final Set DISCONNECTED_CLIENT_EXCEPTIONS; static { Set exceptions = new HashSet<>(); - exceptions.add("AbortedException"); exceptions.add("ClientAbortException"); exceptions.add("EOFException"); exceptions.add("EofException"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerTests.java index c61f09fba99..a704411e835 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerTests.java @@ -38,7 +38,7 @@ import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.result.view.View; import org.springframework.web.reactive.result.view.ViewResolver; import org.springframework.web.server.ServerWebExchange; -import org.springframework.web.server.adapter.HttpWebHandlerAdapter; +import org.springframework.web.util.DisconnectedClientHelper; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -58,8 +58,7 @@ class DefaultErrorWebExceptionHandlerTests { void disconnectedClientExceptionsMatchesFramework() { Object errorHandlers = ReflectionTestUtils.getField(AbstractErrorWebExceptionHandler.class, "DISCONNECTED_CLIENT_EXCEPTIONS"); - Object webHandlers = ReflectionTestUtils.getField(HttpWebHandlerAdapter.class, - "DISCONNECTED_CLIENT_EXCEPTIONS"); + Object webHandlers = ReflectionTestUtils.getField(DisconnectedClientHelper.class, "EXCEPTION_TYPE_NAMES"); assertThat(errorHandlers).isNotNull().isEqualTo(webHandlers); }