String refresh(Claims token, long expirationTime) {
    checkIsStarted();
    return Jwts.builder()
      .claims(token)
      .claim(LAST_REFRESH_TIME_PARAM, system2.now())
      .expiration(new Date(expirationTime))
      .signWith(secretKey, SIGNATURE_ALGORITHM)
      .compact();
  }
@Test
  public void refresh_fail_when_not_started() {
    Claims claims = new DefaultClaimsBuilder().build();
    long time = addMinutes(new Date(), 10).getTime();

    assertThatThrownBy(() -> underTest.refresh(claims, time))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("org.sonar.server.authentication.JwtSerializer not started");
  }