@Test
public void throwsUnhandledExceptionWithCauseOfWebApplicationExceptionWhenJspErrorPageIsAvailableForErrorStatus() throws Exception {

    ErrorPages errorPages = mock(ErrorPages.class);
    when(errorPages.hasErrorPage(403)).thenReturn(true);
    when(environmentContext.get(ErrorPages.class)).thenReturn(errorPages);
    WebApplicationException webApplicationException = new WebApplicationException(403);
    doThrow(webApplicationException).when(requestDispatcher).dispatch(request, response);
    thrown.expect(UnhandledException.class);
    thrown.expect(unhandledExceptionWIthStatusMatcher(403));
    requestHandler.handleRequest(request, response);
}