@Test
    void verifyWebflowAuthenticated() throws Exception {
        val requestContext = MockRequestContext.create(applicationContext);
        requestContext.setParameter(CasDefaultFlowUrlHandler.DEFAULT_FLOW_EXECUTION_KEY_PARAMETER, UUID.randomUUID().toString());
        assertTrue(securityContextRepository.containsContext(requestContext.getHttpServletRequest()));
        val secContext = securityContextRepository.loadDeferredContext(requestContext.getHttpServletRequest()).get();
        val principal = (User) secContext.getAuthentication().getPrincipal();
        assertEquals(USERNAME, principal.getUsername());
        assertEquals(USERNAME, secContext.getAuthentication().getName());
        assertTrue(secContext.getAuthentication().getAuthorities().size() > 1);
        assertTrue(secContext.getAuthentication().getAuthorities().stream()
            .anyMatch(auth -> "ROLE_USER".equalsIgnoreCase(auth.getAuthority())));
    }
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