@Test
public void checkTokenExpiration() {

    final String header = "{\"header\":\"value\"}";
    final String payload = String.format("{\"exp\":%d}", Instant.now().getEpochSecond());
    final String signature = "{\"signature\":\"foo\"}";
    final String authorizationHeader = "Bearer " + base64(header) + "." + base64(payload) + "." + base64(signature);
    final JsonWebToken expiredJsonWebToken = ImmutableJsonWebToken.fromAuthorization(authorizationHeader);
    assertThat(expiredJsonWebToken.isExpired()).isEqualTo(true);
}