@Test
    void verifyProvider() {
        val props = new CasConfigurationProperties();
        val timeProps = new TimeBasedAuthenticationProperties();
        timeProps.setProviderId(TestMultifactorAuthenticationProvider.ID);
        timeProps.setOnOrAfterHour(0);
        timeProps.setOnOrBeforeHour(24);
        timeProps.setOnDays(List.of("Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"));
        props.getAuthn().getAdaptive().getPolicy().getRequireTimedMultifactor().add(timeProps);

        var trigger = new TimedMultifactorAuthenticationTrigger(props, applicationContext);
        var result = trigger.isActivated(authentication, registeredService, this.httpRequest, this.httpResponse, mock(Service.class));
        assertTrue(result.isPresent());

        timeProps.setProviderId("bad-id");
        val trigger2 = new TimedMultifactorAuthenticationTrigger(props, applicationContext);
        assertThrows(AuthenticationException.class,
            () -> trigger2.isActivated(authentication, registeredService, this.httpRequest, this.httpResponse, mock(Service.class)));
    }
This is {@link TimedMultifactorAuthenticationTriggerTests}.

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