@Test void getTokenLifetimeDuration() { long issueToken = Instant.now().minusSeconds(150).toEpochMilli() / 1000; long expiration = Instant.now().plusSeconds(150).toEpochMilli() /1000; TokenExpirationInfoBO token = new TokenExpirationInfoBO(issueToken, expiration); Duration tokenLifetimeDuration = token.getTokenLifetimeDuration(); assertThat(tokenLifetimeDuration.minus(Duration.parse("PT2M30S")).getSeconds() < 5, is(true)); }
public Duration getTokenLifetimeDuration() { return Duration.between(issuedAt, Instant.now()); }
TokenExpirationInfoBO { public Duration getTokenLifetimeDuration() { return Duration.between(issuedAt, Instant.now()); } }
TokenExpirationInfoBO { public Duration getTokenLifetimeDuration() { return Duration.between(issuedAt, Instant.now()); } TokenExpirationInfoBO();  TokenExpirationInfoBO(long issuedAt, long expiration); }
TokenExpirationInfoBO { public Duration getTokenLifetimeDuration() { return Duration.between(issuedAt, Instant.now()); } TokenExpirationInfoBO();  TokenExpirationInfoBO(long issuedAt, long expiration); Duration getTokenExpirationDuration(); Duration getTokenLifetimeDuration(); boolean isDurationPassed(Duration duration); boolean isDurationPassed(Duration duration, Instant comparing); boolean isExpired(); boolean isPartLifetimePassed(double part); Instant getIssuedAt(); void setIssuedAt(Instant issuedAt); Instant getExpiration(); void setExpiration(Instant expiration); @Override String toString(); }
TokenExpirationInfoBO { public Duration getTokenLifetimeDuration() { return Duration.between(issuedAt, Instant.now()); } TokenExpirationInfoBO();  TokenExpirationInfoBO(long issuedAt, long expiration); Duration getTokenExpirationDuration(); Duration getTokenLifetimeDuration(); boolean isDurationPassed(Duration duration); boolean isDurationPassed(Duration duration, Instant comparing); boolean isExpired(); boolean isPartLifetimePassed(double part); Instant getIssuedAt(); void setIssuedAt(Instant issuedAt); Instant getExpiration(); void setExpiration(Instant expiration); @Override String toString();  }