@Test
    void verifyOperation() throws Throwable {
        val registeredService = RegisteredServiceTestUtils.getRegisteredService(RegisteredServiceTestUtils.CONST_TEST_URL);
        registeredService.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy());
        servicesManager.save(registeredService);
        val results = endpoint.produceToken("casuser", RegisteredServiceTestUtils.CONST_TEST_URL);
        assertTrue(results.containsKey("registeredService"));
        assertTrue(results.containsKey("token"));
        val token = results.get("token").toString();
        val service = RegisteredServiceTestUtils.getService(RegisteredServiceTestUtils.CONST_TEST_URL);
        val authnResults = tokenAuthenticationHandler.authenticate(new TokenCredential(token, service), service);
        assertEquals("casuser", authnResults.getPrincipal().getId());
        assertNotNull(endpoint.validateToken(token, service.getId()));
    }
This is {@link TokenAuthenticationEndpointTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-token-webflow/src/test/java/org/apereo/cas/web/TokenAuthenticationEndpointTests.java