mirror of https://github.com/jwtk/jjwt.git
107: ensured exception message printed UTC times correctly
This commit is contained in:
parent
0f63ec8012
commit
1974069561
|
@ -56,7 +56,7 @@ import java.util.Map;
|
|||
public class DefaultJwtParser implements JwtParser {
|
||||
|
||||
//don't need millis since JWT date fields are only second granularity:
|
||||
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
|
||||
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
||||
|
||||
private ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
|
|
|
@ -175,6 +175,9 @@ class JwtParserTest {
|
|||
fail()
|
||||
} catch (ExpiredJwtException e) {
|
||||
assertTrue e.getMessage().startsWith('JWT expired at ')
|
||||
|
||||
//https://github.com/jwtk/jjwt/issues/107 :
|
||||
assertTrue e.getMessage().endsWith('Z')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,6 +193,9 @@ class JwtParserTest {
|
|||
fail()
|
||||
} catch (PrematureJwtException e) {
|
||||
assertTrue e.getMessage().startsWith('JWT must not be accepted before ')
|
||||
|
||||
//https://github.com/jwtk/jjwt/issues/107 :
|
||||
assertTrue e.getMessage().endsWith('Z')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue