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

        val casProperties = new CasConfigurationProperties();
        val trigger = new GrouperMultifactorAuthenticationTrigger(casProperties,
            mock(MultifactorAuthenticationProviderResolver.class), mock(GrouperFacade.class),
            applicationContext);

        assertTrue(trigger.isActivated(RegisteredServiceTestUtils.getAuthentication(),
            RegisteredServiceTestUtils.getRegisteredService(),
            new MockHttpServletRequest(), new MockHttpServletResponse(), RegisteredServiceTestUtils.getService()).isEmpty());

        casProperties.getAuthn().getMfa().getTriggers().getGrouper().setGrouperGroupField("name");
        assertTrue(trigger.isActivated(RegisteredServiceTestUtils.getAuthentication(),
            null,
            new MockHttpServletRequest(), new MockHttpServletResponse(), RegisteredServiceTestUtils.getService()).isEmpty());

        assertThrows(AuthenticationException.class,
            () -> trigger.isActivated(RegisteredServiceTestUtils.getAuthentication(),
                RegisteredServiceTestUtils.getRegisteredService(),
                new MockHttpServletRequest(), new MockHttpServletResponse(), RegisteredServiceTestUtils.getService()));
    }
This is {@link GrouperMultifactorAuthenticationTriggerTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-grouper/src/test/java/org/apereo/cas/web/flow/GrouperMultifactorAuthenticationTriggerTests.java