@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public Action testWebflowSerialization() {
            //CHECKSTYLE:OFF
            return new BaseCasWebflowAction() {
                @Override
                protected Event doExecuteInternal(final RequestContext requestContext) {
                    val flowScope = requestContext.getFlowScope();
                    flowScope.put("test", TEST);
                    flowScope.put("test0", Collections.singleton(TEST));
                    flowScope.put("test1", List.of(TEST));
                    flowScope.put("test2", Map.of(TEST, TEST));
                    flowScope.put("test3", Arrays.asList(TEST, TEST));
                    flowScope.put("test4", new ConcurrentSkipListSet());
                    flowScope.put("test5", List.of("test1"));
                    flowScope.put("test6", Collections.unmodifiableSet(Collections.singleton(1)));
                    flowScope.put("test7", Collections.unmodifiableMap(new HashMap<>()));
                    flowScope.put("test8", Collections.emptyMap());
                    flowScope.put("test9", new TreeMap<>());
                    flowScope.put("test10", Collections.emptySet());
                    flowScope.put("test11", Collections.emptyList());

                    val service = new SimpleWebApplicationServiceImpl();
                    service.setId(CoreAuthenticationTestUtils.CONST_TEST_URL);
                    service.setOriginalUrl(CoreAuthenticationTestUtils.CONST_TEST_URL);
                    service.setArtifactId(null);

                    return FunctionUtils.doUnchecked(() -> {
                        val authentication = CoreAuthenticationTestUtils.getAuthentication();
                        val authenticationResultBuilder = new DefaultAuthenticationResultBuilder(principalElectionStrategy.getObject());
                        val principal = CoreAuthenticationTestUtils.getPrincipal();
                        authenticationResultBuilder.collect(authentication);
                        authenticationResultBuilder.collect(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());
                        val authenticationResult = authenticationResultBuilder.build(service);

                        WebUtils.putAuthenticationResultBuilder(authenticationResultBuilder, requestContext);
                        WebUtils.putAuthenticationResult(authenticationResult, requestContext);
                        WebUtils.putPrincipal(requestContext, principal);

                        return success();
                    });
                }
            };
            //CHECKSTYLE:ON
        }
The type Test webflow context configuration.
support/cas-server-support-webconfig/src/test/java/org/apereo/cas/webflow/BaseCasWebflowSessionContextConfigurationTests.java