@Test
    void verifyServiceUnauthz() throws Throwable {
        assertTrue(handler.supports(new UnauthorizedAuthenticationException("failure"), context));

        WebUtils.putUnauthorizedRedirectUrlIntoFlowScope(context, new URI("https://github.com"));
        val ex = new AuthenticationException(new UnauthorizedServiceForPrincipalException("failure",
            CoreAuthenticationTestUtils.getRegisteredService(), "casuser", Map.of()));
        val event = handler.handle(ex, context);
        assertNotNull(event);
        assertEquals(CasWebflowConstants.STATE_ID_SERVICE_UNAUTHZ_CHECK, event.getId());
    }
This is {@link DefaultCasWebflowAuthenticationExceptionHandlerTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-webflow/src/test/java/org/apereo/cas/web/flow/authentication/DefaultCasWebflowAuthenticationExceptionHandlerTests.java