mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 22:59:03 +00:00
Exclude DataAccessException and MessagingException in DisconnectedClientHelper
Closes gh-36134
This commit is contained in:
+11
-7
@@ -28,7 +28,9 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import reactor.netty.channel.AbortedException;
|
||||
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.web.client.ResourceAccessException;
|
||||
import org.springframework.web.context.request.async.AsyncRequestNotUsableException;
|
||||
import org.springframework.web.testfixture.http.MockHttpInputMessage;
|
||||
@@ -78,16 +80,18 @@ public class DisconnectedClientHelperTests {
|
||||
assertThat(DisconnectedClientHelper.isClientDisconnectedException(ex)).isTrue();
|
||||
}
|
||||
|
||||
@Test // gh-34264
|
||||
void onwardClientDisconnectedExceptionPhrase() {
|
||||
Exception ex = new ResourceAccessException("I/O error", new EOFException("Connection reset by peer"));
|
||||
@ParameterizedTest // gh-34264
|
||||
@MethodSource("excludedExceptionsTypes")
|
||||
void excludedExceptionTypes(Exception ex) {
|
||||
assertThat(DisconnectedClientHelper.isClientDisconnectedException(ex)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void onwardClientDisconnectedExceptionType() {
|
||||
Exception ex = new ResourceAccessException("I/O error", new EOFException());
|
||||
assertThat(DisconnectedClientHelper.isClientDisconnectedException(ex)).isFalse();
|
||||
static List<Exception> excludedExceptionsTypes() {
|
||||
EOFException cause = new EOFException();
|
||||
return List.of(
|
||||
new ResourceAccessException("", cause),
|
||||
new DataAccessResourceFailureException("", new EOFException()),
|
||||
new MessagingException("", cause));
|
||||
}
|
||||
|
||||
@Test // gh-34533
|
||||
|
||||
Reference in New Issue
Block a user