@Test public void isValidShouldRecognizeTokenWhereSignatureIsModified() throws Exception { zonedDateTimeProvider.setFixedDateTime(DATE); ContinuationToken continuationToken = tokenFactory.generateContinuationToken("user"); ContinuationToken pirateContinuationToken = new ContinuationToken(continuationToken.getUsername(), continuationToken.getExpirationDate(), FAKE_SIGNATURE); assertThat(tokenManager.isValid(pirateContinuationToken)).isFalse(); }
@Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token);  }