@Test
    void verifyOperation() {
        val request = new MockHttpServletRequest();
        var result = defaultMappedExceptionErrorViewResolver.resolveErrorView(request, HttpStatus.FORBIDDEN, Map.of());
        assertNull(result);

        request.setAttribute("jakarta.servlet.error.exception", UnauthorizedServiceException.denied("Forbidden"));
        result = defaultMappedExceptionErrorViewResolver.resolveErrorView(request, HttpStatus.FORBIDDEN, Map.of());
        assertEquals(CasWebflowConstants.VIEW_ID_SERVICE_ERROR, result.getViewName());
        assertTrue(result.getModel().containsKey(CasWebflowConstants.ATTRIBUTE_ERROR_ROOT_CAUSE_EXCEPTION));
    }
This is {@link MappedExceptionErrorViewResolverTests}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-web/src/test/java/org/apereo/cas/web/support/MappedExceptionErrorViewResolverTests.java