@Test public void generateContinuationTokenShouldHaveTheRightOutPut() throws Exception { zonedDateTimeProvider.setFixedDateTime(DATE); assertThat(toKenFactory.generateContinuationToken("user").serialize()) .isEqualTo("user_2011-12-03T10:30:30+01:00_eOvOqTmV3dPrhIkbuQSj2sno3YJMxWl6J1sH1JhwYcaNgMX9twm98/WSF9uyDkvJgvBxFokDr53AbxQ3DsJysB2dAzCC0tUM4u8ZMvl/hQrFXhVCdpVMyHRvixKCxnHsVXAr9g3WMn2vbIVq5i3HPgA6/p9FB1+N4WA06B8ueoCrdxT2w1ITEm8p+QZvje3n1F344SgrqgIYqvt0yUvzxnB24f3ccjAKidlBj4wZkcXgUTMbZ7MdnCbDGbp10+tgJqxiv1S0rXZMeJLJ+vBt5TyqEhsJUmUQ84qctlB4yR5FS+ncbAOyZAxs2dWsHqiQjedb3IR77N7CASzqO2mmVw=="); }
@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);  }