protected void executeAction(final MultifactorAuthenticationProvider provider,
                                     final MultifactorAuthenticationProviderFailureModes serviceMode,
                                     final String transitionId) throws Exception {
            val context = MockRequestContext.create(applicationContext);
            val service = RegisteredServiceTestUtils.getRegisteredService(UUID.randomUUID().toString());

            if (serviceMode != null) {
                val policy = new DefaultRegisteredServiceMultifactorPolicy();
                policy.setFailureMode(serviceMode);
                service.setMultifactorAuthenticationPolicy(policy);
            } else {
                service.setMultifactorAuthenticationPolicy(null);
            }
            servicesManager.save(service);
            WebUtils.putRegisteredService(context, service);
            MultifactorAuthenticationWebflowUtils.putMultifactorAuthenticationProvider(context, provider);
            val event = mfaFailureAction.execute(context);
            assertEquals(transitionId, event.getId());
        }
This is {@link MultifactorAuthenticationFailureActionTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-webflow-mfa/src/test/java/org/apereo/cas/web/flow/MultifactorAuthenticationFailureActionTests.java