Search in sources :

Example 1 with AsyncRequestTimeoutException

use of org.springframework.web.context.request.async.AsyncRequestTimeoutException in project spring-framework by spring-projects.

the class DefaultHandlerExceptionResolverTests method handleAsyncRequestTimeoutException.

// SPR-14669
@Test
public void handleAsyncRequestTimeoutException() throws Exception {
    Exception ex = new AsyncRequestTimeoutException();
    ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);
    assertThat(mav).as("No ModelAndView returned").isNotNull();
    assertThat(mav.isEmpty()).as("No Empty ModelAndView returned").isTrue();
    assertThat(response.getStatus()).as("Invalid status code").isEqualTo(503);
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) AsyncRequestTimeoutException(org.springframework.web.context.request.async.AsyncRequestTimeoutException) MissingPathVariableException(org.springframework.web.bind.MissingPathVariableException) HttpMessageNotWritableException(org.springframework.http.converter.HttpMessageNotWritableException) NoHandlerFoundException(org.springframework.web.servlet.NoHandlerFoundException) MissingServletRequestPartException(org.springframework.web.multipart.support.MissingServletRequestPartException) BindException(org.springframework.validation.BindException) ConversionNotSupportedException(org.springframework.beans.ConversionNotSupportedException) AsyncRequestTimeoutException(org.springframework.web.context.request.async.AsyncRequestTimeoutException) MissingServletRequestParameterException(org.springframework.web.bind.MissingServletRequestParameterException) MethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException) ServletRequestBindingException(org.springframework.web.bind.ServletRequestBindingException) TypeMismatchException(org.springframework.beans.TypeMismatchException) HttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException) HttpMediaTypeNotSupportedException(org.springframework.web.HttpMediaTypeNotSupportedException) HttpRequestMethodNotSupportedException(org.springframework.web.HttpRequestMethodNotSupportedException) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ConversionNotSupportedException (org.springframework.beans.ConversionNotSupportedException)1 TypeMismatchException (org.springframework.beans.TypeMismatchException)1 HttpMessageNotReadableException (org.springframework.http.converter.HttpMessageNotReadableException)1 HttpMessageNotWritableException (org.springframework.http.converter.HttpMessageNotWritableException)1 BindException (org.springframework.validation.BindException)1 HttpMediaTypeNotSupportedException (org.springframework.web.HttpMediaTypeNotSupportedException)1 HttpRequestMethodNotSupportedException (org.springframework.web.HttpRequestMethodNotSupportedException)1 MethodArgumentNotValidException (org.springframework.web.bind.MethodArgumentNotValidException)1 MissingPathVariableException (org.springframework.web.bind.MissingPathVariableException)1 MissingServletRequestParameterException (org.springframework.web.bind.MissingServletRequestParameterException)1 ServletRequestBindingException (org.springframework.web.bind.ServletRequestBindingException)1 AsyncRequestTimeoutException (org.springframework.web.context.request.async.AsyncRequestTimeoutException)1 MissingServletRequestPartException (org.springframework.web.multipart.support.MissingServletRequestPartException)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1 NoHandlerFoundException (org.springframework.web.servlet.NoHandlerFoundException)1