mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add test
This commit is contained in:
parent
c3dc4713d3
commit
230ec1c479
@ -69,4 +69,14 @@ public class JWTValidatorTest {
|
||||
boolean validate = JWT.of(token).setKey(key).validate(0);
|
||||
Assert.assertFalse(validate);
|
||||
}
|
||||
|
||||
@Test(expected = ValidateException.class)
|
||||
public void validateDateTest(){
|
||||
final JWT jwt = JWT.create()
|
||||
.setPayload("id", 123)
|
||||
.setPayload("username", "hutool")
|
||||
.setExpiresAt(DateUtil.parse("2021-10-13 09:59:00"));
|
||||
|
||||
JWTValidator.of(jwt).validateDate(DateUtil.date());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user