@Test
    void verifyGlobalFailureModeFailsOpen() throws Throwable {
        val applicationContext = buildApplicationContext();

        val provider = TestUnavailableMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        val casProperties = new CasConfigurationProperties();
        casProperties.getAuthn().getMfa().getCore().setGlobalFailureMode(BaseMultifactorAuthenticationProviderProperties.MultifactorAuthenticationProviderFailureModes.OPEN);
        val failureEvaluator = new DefaultMultifactorAuthenticationFailureModeEvaluator(casProperties);
        provider.setFailureModeEvaluator(failureEvaluator);

        val servicesManager = mock(ServicesManager.class);
        val validator = MultifactorAuthenticationTestUtils.mockRequestAuthnContextValidator(servicesManager,
            Optional.of(provider), applicationContext,
            BaseMultifactorAuthenticationProviderProperties.MultifactorAuthenticationProviderFailureModes.UNDEFINED.toString());

        val assertion = mock(Assertion.class);
        val principal = MultifactorAuthenticationTestUtils.getPrincipal(CASUSER);
        val auth = MultifactorAuthenticationTestUtils.getAuthentication(principal, AUTH_ATTRIBUTES);
        when(assertion.getPrimaryAuthentication()).thenReturn(auth);
        val result = validator.validateAuthenticationContext(assertion, new MockHttpServletRequest(), new MockHttpServletResponse());
        assertTrue(result.isSuccess());
    }
This is {@link DefaultMultifactorAuthenticationContextValidatorTests}.

@author Misagh Moayyed
@since 6.0.5
core/cas-server-core-authentication-mfa-api/src/test/java/org/apereo/cas/authentication/mfa/DefaultRequestedAuthenticationContextValidatorTests.java