Skip to content

Commit 124b384

Browse files
committed
Remove unused code and improve assertion
See gh-34363
1 parent b07217a commit 124b384

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerErrorTests.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,10 @@ void startCallableProcessingDisconnectedClient() throws Exception {
162162
AsyncEvent event = new AsyncEvent(new MockAsyncContext(this.servletRequest, this.servletResponse), ex);
163163
this.asyncWebRequest.onError(event);
164164

165-
MockAsyncContext asyncContext = (MockAsyncContext) this.servletRequest.getAsyncContext();
166165
assertThat(this.asyncManager.hasConcurrentResult()).isTrue();
167166
assertThat(this.asyncManager.getConcurrentResult())
168-
.as("Disconnected client error not wrapped AsyncRequestNotUsableException")
169-
.isOfAnyClassIn(AsyncRequestNotUsableException.class);
167+
.as("Disconnected client error not wrapped in AsyncRequestNotUsableException")
168+
.isExactlyInstanceOf(AsyncRequestNotUsableException.class);
170169
}
171170

172171
@Test
@@ -287,8 +286,8 @@ void startDeferredResultProcessingDisconnectedClient() throws Exception {
287286

288287
assertThat(this.asyncManager.hasConcurrentResult()).isTrue();
289288
assertThat(deferredResult.getResult())
290-
.as("Disconnected client error not wrapped AsyncRequestNotUsableException")
291-
.isOfAnyClassIn(AsyncRequestNotUsableException.class);
289+
.as("Disconnected client error not wrapped in AsyncRequestNotUsableException")
290+
.isExactlyInstanceOf(AsyncRequestNotUsableException.class);
292291
}
293292

294293

0 commit comments

Comments
 (0)