@Test
public void testAccessToken() {

    long now = System.currentTimeMillis() / 1000;
    AccessToken accessToken = createAccessToken(now);
    // verify the getters
    validateAccessToken(accessToken, now);
    // now get the signed token
    PrivateKey privateKey = Crypto.loadPrivateKey(ecPrivateKey);
    String accessJws = accessToken.getSignedToken(privateKey, "eckey1", SignatureAlgorithm.ES256);
    assertNotNull(accessJws);
    // now verify our signed token
    PublicKey publicKey = Crypto.loadPublicKey(ecPublicKey);
    Jws<Claims> claims = Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(accessJws);
    assertNotNull(claims);
    assertEquals("subject", claims.getBody().getSubject());
    assertEquals("coretech", claims.getBody().getAudience());
    assertEquals("athenz", claims.getBody().getIssuer());
    List<String> scopes = (List<String>) claims.getBody().get("scp");
    assertNotNull(scopes);
    assertEquals(1, scopes.size());
    assertEquals("readers", scopes.get(0));
}