@Test
        void verifyOperationByMultipleProviders() throws Throwable {
            val policy = mock(RegisteredServiceMultifactorPolicy.class);
            when(policy.getPrincipalAttributeNameTrigger()).thenReturn("mail");
            when(policy.getPrincipalAttributeValueToMatch()).thenReturn(".+@example.*");
            when(policy.getMultifactorAuthenticationProviders()).thenReturn(Set.of(
                TestMultifactorAuthenticationProvider.ID, simpleProvider.getId()));
            val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
            when(registeredService.getMultifactorAuthenticationPolicy()).thenReturn(policy);
            val result = registeredServicePrincipalAttributeMultifactorAuthenticationTrigger.isActivated(
                CoreAuthenticationTestUtils.getAuthentication(), registeredService,
                new MockHttpServletRequest(), new MockHttpServletResponse(),
                CoreAuthenticationTestUtils.getService());
            assertTrue(result.isPresent());
            assertEquals(simpleProvider.getId(), result.get().getId());
        }
This is {@link RegisteredServicePrincipalAttributeMultifactorAuthenticationTriggerTests}.

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