private static void assertProviderResolutionFromManyProviders(final MultifactorAuthenticationTrigger trigger,
                                                                  final ConfigurableApplicationContext applicationContext,
                                                                  final boolean assertPresence) throws Throwable {
        val context = MockRequestContext.create(applicationContext);

        val provider1 = new TestMultifactorAuthenticationProvider();
        provider1.setOrder(10);
        registerProviderInApplicationContext(applicationContext, context, provider1);

        val provider2 = new TestMultifactorAuthenticationProvider("mfa-other");
        provider2.setOrder(1);
        registerProviderInApplicationContext(applicationContext, context, provider2);

        val principal = CoreAuthenticationTestUtils.getPrincipal("casuser",
            CollectionUtils.wrap("mfa-principal", List.of(provider2.getId())));
        val authentication = CoreAuthenticationTestUtils.getAuthentication(principal, CollectionUtils.wrap("mfa-authn", List.of(provider2.getId())));
        val result = trigger.isActivated(
            authentication,
            CoreAuthenticationTestUtils.getRegisteredService(), context.getHttpServletRequest(),
            context.getHttpServletResponse(),
            CoreAuthenticationTestUtils.getService());
        if (assertPresence) {
            assertTrue(result.isPresent());
            assertEquals(provider2.getId(), result.get().getId());
        } else {
            assertTrue(result.isEmpty());
        }
    }
This is {@link DefaultMultifactorAuthenticationProviderResolverTests}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-authentication-mfa/src/test/java/org/apereo/cas/authentication/DefaultMultifactorAuthenticationProviderResolverTests.java