@Test
    void verifyUnauthzServicesWithMismatchedRealm() {
        val request = new MockHttpServletRequest();

        val registeredService = getWsFederationRegisteredService("custom-realm");
        request.addParameter(WSFederationConstants.WTREALM, "custom-realm");
        request.addParameter(WSFederationConstants.WREPLY, registeredService.getServiceId());
        request.addParameter(WSFederationConstants.WA, WSFederationConstants.WSIGNOUT10);
        val wsFedRequest = WSFederationRequest.of(request);
        val service = RegisteredServiceTestUtils.getService(registeredService.getServiceId());
        assertThrows(UnauthorizedServiceException.class,
            () -> federationValidateRequestController.findAndValidateFederationRequestForRegisteredService(service, wsFedRequest));
    }
This is {@link WSFederationValidateRequestControllerTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-ws-idp/src/test/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestControllerTests.java