@Test
    void verifyContextMapping() throws Throwable {
        val registeredService = SamlIdPTestUtils.getSamlRegisteredService();
        val service = RegisteredServiceTestUtils.getService(registeredService.getServiceId());

        val authnRequest = SamlIdPTestUtils.getAuthnRequest(openSamlConfigBean, registeredService);
        var builder = (SAMLObjectBuilder) openSamlConfigBean.getBuilderFactory()
            .getBuilder(AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
        val classRef = (AuthnContextClassRef) builder.buildObject(AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
        classRef.setURI("context1");
        builder = (SAMLObjectBuilder) openSamlConfigBean.getBuilderFactory()
            .getBuilder(RequestedAuthnContext.DEFAULT_ELEMENT_NAME);
        val reqCtx = (RequestedAuthnContext) builder.buildObject(RequestedAuthnContext.DEFAULT_ELEMENT_NAME);
        reqCtx.setComparison(AuthnContextComparisonTypeEnumeration.EXACT);
        reqCtx.getAuthnContextClassRefs().add(classRef);
        authnRequest.setRequestedAuthnContext(reqCtx);

        val request = new MockHttpServletRequest();
        request.addParameter(SamlIdPConstants.AUTHN_REQUEST_ID, authnRequest.getID());
        val response = new MockHttpServletResponse();

        val messageContext = new MessageContext();
        signAuthnRequest(request, response, authnRequest, registeredService, messageContext);
        messageContext.setMessage(authnRequest);
        val context = Pair.of(authnRequest, messageContext);

        SamlIdPSessionManager.of(openSamlConfigBean, samlIdPDistributedSessionStore)
            .store(new JEEContext(request, response), context);
        assertTrue(samlIdPMultifactorAuthenticationTrigger.supports(request, registeredService,
            RegisteredServiceTestUtils.getAuthentication(), service));
        val result = samlIdPMultifactorAuthenticationTrigger.isActivated(RegisteredServiceTestUtils.getAuthentication(),
            registeredService, request, response, service);
        assertTrue(result.isPresent());
    }
This is {@link SamlIdPMultifactorAuthenticationTriggerTests}.

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