@Test
    void verifyOperationByPolicyForPrincipal() throws Throwable {
        val policy = mock(RegisteredServiceMultifactorPolicy.class);
        when(policy.getMultifactorAuthenticationProviders()).thenReturn(Set.of("mfa-dummy"));
        when(policy.getPrincipalAttributeNameTrigger()).thenReturn("mail");
        when(policy.getPrincipalAttributeValueToMatch()).thenReturn("@example.org");
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        when(registeredService.getMultifactorAuthenticationPolicy()).thenReturn(policy);
        val result = registeredServiceMultifactorAuthenticationTrigger.isActivated(
            CoreAuthenticationTestUtils.getAuthentication(), registeredService,
            new MockHttpServletRequest(), new MockHttpServletResponse(),
            CoreAuthenticationTestUtils.getService());
        assertFalse(result.isPresent());
    }
This is {@link RegisteredServiceMultifactorAuthenticationTriggerTests}.

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