Remove unused code and improve assertion

See gh-34363
This commit is contained in:
Sam Brannen
2025-02-11 16:30:52 +01:00
parent b07217ab67
commit 124b38450b

View File

@@ -162,11 +162,10 @@ class WebAsyncManagerErrorTests {
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 @@ class WebAsyncManagerErrorTests {
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);
}