@Test
    void verifyAuthnRequestWithRequesterIDs() throws Throwable {
        val filter = new AuthnRequestRequesterIdAttributeReleasePolicy();
        filter.setAllowedAttributes(List.of("eduPersonPrincipalName"));
        filter.setRequesterIdPattern(".+sp.testshib.org.*");

        val registeredService = SamlIdPTestUtils.getSamlRegisteredService();
        registeredService.setAttributeReleasePolicy(filter);

        val builder = new SAML2AuthnRequestBuilder();
        val authnRequest = builder.build(saml2MessageContext);

        val scoping = ((SAMLObjectBuilder<Scoping>) openSamlConfigBean.getBuilderFactory()
            .getBuilder(Scoping.DEFAULT_ELEMENT_NAME)).buildObject();
        val requesterId = ((SAMLObjectBuilder<RequesterID>) openSamlConfigBean.getBuilderFactory()
            .getBuilder(RequesterID.DEFAULT_ELEMENT_NAME)).buildObject();
        requesterId.setURI("https://sp.testshib.org/shibboleth-sp");
        scoping.getRequesterIDs().add(requesterId);

        authnRequest.setScoping(scoping);
        storeSamlAuthnRequest(authnRequest);

        val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext
            .builder()
            .registeredService(registeredService)
            .service(CoreAuthenticationTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(CoreAuthenticationTestUtils.getPrincipal("casuser",
                CollectionUtils.wrap("eduPersonPrincipalName", "casuser", "givenName", "CAS")))
            .build();
        val attributes = filter.getAttributes(releasePolicyContext);
        assertTrue(attributes.containsKey("eduPersonPrincipalName"));
    }
This is {@link AuthnRequestRequesterIdAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/services/AuthnRequestRequesterIdAttributeReleasePolicyTests.java