@Bean
        public FlowExecutor loginFlowExecutor() {
            val conversationScope = new LocalAttributeMap<>();
            WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication(USERNAME), conversationScope);
            val flowExecution = mock(FlowExecution.class);
            when(flowExecution.getConversationScope()).thenReturn(conversationScope);
            val executor = mock(CasFlowExecutor.class);
            val repository = mock(FlowExecutionRepository.class);
            when(repository.parseFlowExecutionKey(anyString())).thenReturn(mock(FlowExecutionKey.class));
            when(repository.getFlowExecution(any(FlowExecutionKey.class))).thenReturn(flowExecution);
            when(executor.getFlowExecutionRepository()).thenReturn(repository);
            when(executor.getFlowUrlHandler()).thenReturn(new CasDefaultFlowUrlHandler(List.of()));
            return executor;
        }
This is {@link CasWebflowSecurityContextRepositoryTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-webconfig/src/test/java/org/apereo/cas/web/security/authentication/CasWebflowSecurityContextRepositoryTests.java