Jwt { public String getSubject() throws JwtExpiredException, JwtNotBeforeException { return (String) getClaim(JwtNames.CLAIM_SUBJECT); } Jwt(JSONObject header, JSONObject payload, Clock clock, Duration clockSkew); String getIssuer(); String getSubject(); List<String> getAudiences(); String getJwtId(); Instant getExpiration(); Instant getNotBefore(); Instant getIssuedAt(); Object getClaim(String name); String getType(); String getContentType(); String getAlgorithm(); String getKeyId();  }
@Test public void getSubject_success() throws Exception { JSONObject payload = new JSONObject(); payload.put(JwtNames.CLAIM_SUBJECT, "foo"); Jwt token = new Jwt(new JSONObject(), payload, Clock.systemUTC(), Duration.ZERO); assertThat(token.getSubject()).isEqualTo("foo"); }