@Test
    void verifyOperation() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);

        val eval = new DefaultChainingMultifactorAuthenticationBypassProvider(applicationContext);
        val bypassProps = new MultifactorAuthenticationProviderBypassProperties();
        bypassProps.setCredentialClassType(UsernamePasswordCredential.class.getName());
        eval.addMultifactorAuthenticationProviderBypassEvaluator(
            new CredentialMultifactorAuthenticationProviderBypassEvaluator(bypassProps, TestMultifactorAuthenticationProvider.ID, applicationContext));

        val principal = CoreAuthenticationTestUtils.getPrincipal(Map.of("cn", List.of("example")));
        val authentication = CoreAuthenticationTestUtils.getAuthentication(principal);
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        val policy = new DefaultRegisteredServiceMultifactorPolicy();
        when(registeredService.getMultifactorAuthenticationPolicy()).thenReturn(policy);
        assertFalse(eval.shouldMultifactorAuthenticationProviderExecute(authentication, registeredService,
            provider, new MockHttpServletRequest(), CoreAuthenticationTestUtils.getService()));

        bypassProps.setCredentialClassType(BasicIdentifiableCredential.class.getName());
        assertTrue(eval.shouldMultifactorAuthenticationProviderExecute(authentication, registeredService,
            provider, new MockHttpServletRequest(), CoreAuthenticationTestUtils.getService()));

    }
This is {@link CredentialMultifactorAuthenticationProviderBypassEvaluatorTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-authentication-mfa/src/test/java/org/apereo/cas/authentication/bypass/CredentialMultifactorAuthenticationProviderBypassEvaluatorTests.java