@BeforeEach
    void initialize() throws Exception {
        this.context = MockRequestContext.create(applicationContext);
        context.setRemoteAddr("185.86.151.11").setLocalAddr("195.88.151.11").withUserAgent().setClientInfo();

        val targetResolver = new DefaultTargetStateResolver(TestMultifactorAuthenticationProvider.ID);
        val transition = new Transition(new DefaultTransitionCriteria(
            new LiteralExpression(TestMultifactorAuthenticationProvider.ID)), targetResolver);
        context.getRootFlow().getGlobalTransitionSet().add(transition);

        WebUtils.putServiceIntoFlowScope(context, CoreAuthenticationTestUtils.getWebApplicationService());
        TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication(), context);
    }
This is {@link GroovyScriptMultifactorAuthenticationPolicyEventResolverTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-webflow-mfa/src/test/java/org/apereo/cas/GroovyScriptMultifactorAuthenticationPolicyEventResolverTests.java