MCPcopy Index your code
hub / github.com/auth0/java-jwt / shouldGetNotBefore

Method shouldGetNotBefore

lib/src/test/java/com/auth0/jwt/JWTTest.java:288–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286 }
287
288 @Test
289 public void shouldGetNotBefore() {
290 long seconds = 1477592;
291 Clock clock = Clock.fixed(Instant.ofEpochSecond(seconds), ZoneId.of("UTC"));
292
293 String token = "eyJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE0Nzc1OTJ9.mWYSOPoNXstjKbZkKrqgkwPOQWEx3F3gMm6PMcfuJd8";
294 JWTVerifier.BaseVerification verification = (JWTVerifier.BaseVerification) JWT.require(Algorithm.HMAC256("secret"));
295 DecodedJWT jwt = verification
296 .build(clock)
297 .verify(token);
298
299 assertThat(jwt, is(notNullValue()));
300 assertThat(jwt.getNotBefore(), is(equalTo(new Date(seconds * 1000))));
301 assertThat(jwt.getNotBeforeAsInstant(), is(equalTo(Instant.ofEpochSecond(seconds))));
302 }
303
304 @Test
305 public void shouldGetIssuedAt() {

Callers

nothing calls this directly

Calls 6

requireMethod · 0.95
HMAC256Method · 0.95
verifyMethod · 0.65
buildMethod · 0.65
getNotBeforeMethod · 0.65
getNotBeforeAsInstantMethod · 0.65

Tested by

no test coverage detected