添加对JwtUtil的单元测试,确保功能可用

This commit is contained in:
高子兴 2024-07-01 16:46:18 +08:00
parent 1f99db9523
commit df25c9c13c

View File

@ -24,7 +24,7 @@ public class JwtUtilTest {
// Validate claims
Assert.assertTrue("Token shoud be valid", JwtUtil.isTokenValid(token, username));
Assert.assertTrue("Token should be valid", JwtUtil.isTokenValid(token, username));
Assert.assertEquals("Username in claims should match", username, claims.getSubject());
Assert.assertTrue("Token should be issued in the past", new Date().after(claims.getIssuedAt()));
Assert.assertTrue("Token expiration should be in the future", new Date().before(claims.getExpiration()));