@Test
    void verifyTokenBuilder() throws Throwable {
        val service = CoreAuthenticationTestUtils.getWebApplicationService("jwtservice");
        val user = UUID.randomUUID().toString();
        val authentication = CoreAuthenticationTestUtils.getAuthentication(user);
        val tgt = new MockTicketGrantingTicket(authentication);
        val st = new MockServiceTicket("ST-123456", service, tgt);
        ticketRegistry.addTicket(tgt);
        ticketRegistry.addTicket(st);

        val result = responseBuilder.build(service, st.getId(), authentication);
        assertNotNull(result);
        assertTrue(result.attributes().containsKey(CasProtocolConstants.PARAMETER_TICKET));
        val ticket = result.attributes().get(CasProtocolConstants.PARAMETER_TICKET);
        assertNotNull(JWTParser.parse(ticket));
    }
This is {@link TokenWebApplicationServiceResponseBuilderTests}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-token-tickets/src/test/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilderTests.java