@Test
    void verifySamlAuthnRequestSigned() throws Throwable {
        val spMetadataPath = new File(FileUtils.getTempDirectory(), "sp-metadata.xml").getCanonicalPath();
        setupTestContextFor(spMetadataPath, "cas:example:sp");

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

        val messageContext = new MessageContext();
        messageContext.setMessage(authnRequest);
        val secContext = messageContext.ensureSubcontext(SecurityParametersContext.class);

        val provider = new DefaultSignatureSigningParametersProvider(saml2ClientConfiguration);
        Objects.requireNonNull(secContext).setSignatureSigningParameters(provider.build(adaptor.getSsoDescriptor()));

        val handler = new SAMLOutboundProtocolMessageSigningHandler();
        handler.initialize();
        handler.invoke(messageContext);

        assertDoesNotThrow(() -> samlObjectSignatureValidator.verifySamlProfileRequest(authnRequest, adaptor, request, samlContext));
    }
This is {@link SamlObjectSignatureValidatorTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlObjectSignatureValidatorTests.java