From 124b38450b5f910515f3b9f9d0e72df547d1f41c Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:30:52 +0100 Subject: [PATCH] Remove unused code and improve assertion See gh-34363 --- .../context/request/async/WebAsyncManagerErrorTests.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerErrorTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerErrorTests.java index d11d6714c0ac..7796e33ffa13 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerErrorTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerErrorTests.java @@ -162,11 +162,10 @@ void startCallableProcessingDisconnectedClient() throws Exception { AsyncEvent event = new AsyncEvent(new MockAsyncContext(this.servletRequest, this.servletResponse), ex); this.asyncWebRequest.onError(event); - MockAsyncContext asyncContext = (MockAsyncContext) this.servletRequest.getAsyncContext(); assertThat(this.asyncManager.hasConcurrentResult()).isTrue(); assertThat(this.asyncManager.getConcurrentResult()) - .as("Disconnected client error not wrapped AsyncRequestNotUsableException") - .isOfAnyClassIn(AsyncRequestNotUsableException.class); + .as("Disconnected client error not wrapped in AsyncRequestNotUsableException") + .isExactlyInstanceOf(AsyncRequestNotUsableException.class); } @Test @@ -287,8 +286,8 @@ void startDeferredResultProcessingDisconnectedClient() throws Exception { assertThat(this.asyncManager.hasConcurrentResult()).isTrue(); assertThat(deferredResult.getResult()) - .as("Disconnected client error not wrapped AsyncRequestNotUsableException") - .isOfAnyClassIn(AsyncRequestNotUsableException.class); + .as("Disconnected client error not wrapped in AsyncRequestNotUsableException") + .isExactlyInstanceOf(AsyncRequestNotUsableException.class); }