@Test
public void responseIsCommittedWhenExceptionIsThrownDuringAsyncDispatch()
throws Exception {
this.filter.addErrorPages(new ErrorPage("/error"));
setUpAsyncDispatch();
this.chain = new MockFilterChain() {
@Override
public void doFilter(ServletRequest request, ServletResponse response)
throws IOException, ServletException {
super.doFilter(request, response);
throw new RuntimeException("BAD");
}
};
this.filter.doFilter(this.request, this.response, this.chain);
assertThat(this.chain.getRequest()).isEqualTo(this.request);
assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse())
.isEqualTo(this.response);
assertThat(this.response.isCommitted()).isTrue();
}
ErrorPageFilterTests.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:spring-boot-concourse
作者:
评论列表
文章目录