@Test
    void verifyJwtWithSubjectResolution() throws Throwable {
        val registeredService = getRegisteredService("clientid2-jwt", "secret2-jwt");
        servicesManager.save(registeredService);
        val service = CoreAuthenticationTestUtils.getService("https://service.example.com");
        val request = JwtBuilder.JwtRequest
            .builder()
            .issueDate(new Date())
            .jwtId(service.getId())
            .serviceAudience(Set.of("clientid2-jwt"))
            .subject("casuser")
            .issuer(casProperties.getServer().getPrefix())
            .resolveSubject(true)
            .registeredService(Optional.of(registeredService))
            .build();
        val jwt = accessTokenJwtBuilder.build(request);
        assertNotNull(jwt);
        val claims = accessTokenJwtBuilder.unpack(jwt);
        assertEquals("casuser", claims.getSubject());
        assertEquals("clientid2-jwt", claims.getAudience().getFirst());
        assertEquals("apereo-cas", claims.getClaim("givenName"));
        assertEquals("cas", claims.getClaim("uid"));

    }
This is {@link OAuth20JwtBuilderTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/ticket/accesstoken/OAuth20JwtBuilderTests.java