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

        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        val props = new MultifactorAuthenticationProviderBypassProperties();
        props.setAuthenticationAttributeName("givenName");
        props.setAuthenticationAttributeValue("Not Bypassed");
        val bypass = new AuthenticationMultifactorAuthenticationProviderBypassEvaluator(props, TestMultifactorAuthenticationProvider.ID, applicationContext);
        provider.setBypassEvaluator(bypass);
        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 attrs = new HashMap<String, List<Object>>();
        attrs.put(MultifactorAuthenticationProviderBypassEvaluator.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA, List.of(true));
        attrs.put(MultifactorAuthenticationProviderBypassEvaluator.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA_PROVIDER,
            List.of(TestMultifactorAuthenticationProvider.ID));

        val auth = MultifactorAuthenticationTestUtils.getAuthentication(principal, attrs);
        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