@Test
    void verifyException() {
        val request = new MockHttpServletRequest();
        request.addParameter("username", "casuser");
        val results = controller.handleUnauthorizedServiceException(request, new IllegalStateException());
        assertEquals(CasWebflowConstants.VIEW_ID_SERVICE_ERROR, results.getViewName());
        assertTrue(results.getModel().containsKey(CasWebflowConstants.ATTRIBUTE_ERROR_ROOT_CAUSE_EXCEPTION));

        assertThrows(UnauthorizedServiceException.class,
            () -> controller.verifySamlRegisteredService(StringUtils.EMPTY, request));
    }
This is {@link SamlIdPProfileHandlerControllerTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/web/idp/profile/SamlIdPProfileHandlerControllerTests.java