@Test
    void verifyResolveBySingleAttribute() throws Exception {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val context = MockRequestContext.create();

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        assertTrue(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderFromApplicationContext(provider.getId(), applicationContext).isPresent());

        val targetResolver = new DefaultTargetStateResolver(TestMultifactorAuthenticationProvider.ID);
        val transition = new Transition(new DefaultTransitionCriteria(
            new LiteralExpression(TestMultifactorAuthenticationProvider.ID)), targetResolver);
        context.getRootFlow().getGlobalTransitionSet().add(transition);

        val result = MultifactorAuthenticationUtils.resolveEventViaSingleAttribute(MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            List.of("mfa-value1"), MultifactorAuthenticationTestUtils.getRegisteredService(),
            MultifactorAuthenticationTestUtils.getService("service"),
            Optional.of(context), provider, (s, mfaProvider) -> RegexUtils.find("mismatch-.+", s));
        assertNull(result);
    }
This is {@link MultifactorAuthenticationUtilsTests}.

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