@Test public void generateContinuationTokenShouldThrowWhenUsernameIsNull() throws Exception { assertThatThrownBy(() -> toKenFactory.generateContinuationToken(null)) .isInstanceOf(NullPointerException.class); }
@Override public ContinuationToken generateContinuationToken(String username) { Preconditions.checkNotNull(username); ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15); return new ContinuationToken(username, expirationTime, signatureHandler.sign( Joiner.on(ContinuationToken.SEPARATOR) .join(username, DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime)))); }
SignedTokenFactory implements SimpleTokenFactory { @Override public ContinuationToken generateContinuationToken(String username) { Preconditions.checkNotNull(username); ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15); return new ContinuationToken(username, expirationTime, signatureHandler.sign( Joiner.on(ContinuationToken.SEPARATOR) .join(username, DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime)))); } }
SignedTokenFactory implements SimpleTokenFactory { @Override public ContinuationToken generateContinuationToken(String username) { Preconditions.checkNotNull(username); ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15); return new ContinuationToken(username, expirationTime, signatureHandler.sign( Joiner.on(ContinuationToken.SEPARATOR) .join(username, DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime)))); } @Inject  SignedTokenFactory(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); }
SignedTokenFactory implements SimpleTokenFactory { @Override public ContinuationToken generateContinuationToken(String username) { Preconditions.checkNotNull(username); ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15); return new ContinuationToken(username, expirationTime, signatureHandler.sign( Joiner.on(ContinuationToken.SEPARATOR) .join(username, DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime)))); } @Inject  SignedTokenFactory(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override ContinuationToken generateContinuationToken(String username); @Override AttachmentAccessToken generateAttachmentAccessToken(String username, String blobId); }
SignedTokenFactory implements SimpleTokenFactory { @Override public ContinuationToken generateContinuationToken(String username) { Preconditions.checkNotNull(username); ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15); return new ContinuationToken(username, expirationTime, signatureHandler.sign( Joiner.on(ContinuationToken.SEPARATOR) .join(username, DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime)))); } @Inject  SignedTokenFactory(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override ContinuationToken generateContinuationToken(String username); @Override AttachmentAccessToken generateAttachmentAccessToken(String username, String blobId);  }