@Test
    void verifyAction() throws Throwable {
        val generator = new JwtGenerator();

        generator.setSignatureConfiguration(new SecretSignatureConfiguration(SIGNING_SECRET, JWSAlgorithm.HS256));
        generator.setEncryptionConfiguration(new SecretEncryptionConfiguration(ENCRYPTION_SECRET, JWEAlgorithm.DIR, EncryptionMethod.A192CBC_HS384));

        val profile = new CommonProfile();
        profile.setId("casuser");
        profile.addAttribute("uid", "uid");
        profile.addAttribute("givenName", "CASUser");
        profile.addAttribute("memberOf", CollectionUtils.wrapSet("system", "cas", "admin"));
        val token = generator.generate(profile);

        val context = MockRequestContext.create(applicationContext);
        context.addHeader(TokenConstants.PARAMETER_NAME_TOKEN, token);

        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService("https://example.token.org"));
        assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, action.execute(context).getId());
    }
This is {@link TokenAuthenticationActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-token-webflow/src/test/java/org/apereo/cas/web/flow/TokenAuthenticationActionTests.java