forked from RyanGoodwill/backend
添加对JwtUtil的单元测试,确保功能可用
This commit is contained in:
parent
1f99db9523
commit
df25c9c13c
@ -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()));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user