JwtUtils { Date getIssuedAtDateFromTokenClaims(Claims claims) { return claims.getIssuedAt(); }  Claims validateTokenAndGetClaims(String token); String createToken(JwtUser userDetails); boolean canTokenBeRefreshed(Claims claims, Date lastPasswordReset); String refreshToken(String token); String getUsernameFromTokenClaims(Claims claims); List<GrantedAuthority> getRolesFromTokenClaims(Claims claims);  }
@Test public void testIssuedAtDateCanBeExtractedFromTokenClaims() { when(claims.getIssuedAt()).thenReturn(ISSUED_AT_DATE); assertThat(jwtUtils.getIssuedAtDateFromTokenClaims(claims)) .isCloseTo(ISSUED_AT_DATE, GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS); verify(claims, times(1)).getIssuedAt(); }