ContinuationToken implements SignedExpiringToken { public String serialize() { return getPayload() + SEPARATOR + signature; } ContinuationToken(String username, ZonedDateTime expirationDate, String signature); static Builder builder(); static ContinuationToken fromString(String serializedToken); String getUsername(); @Override ZonedDateTime getExpirationDate(); @Override String getSignature(); String serialize(); @Override String getPayload(); @Override String getSignedContent(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static final String SEPARATOR; }
@Test public void getAsStringShouldReturnACorrectResult() throws Exception { assertThat(new ContinuationToken(USER, expirationDate, SIGNATURE).serialize()) .isEqualTo(USER + ContinuationToken.SEPARATOR + EXPIRATION_DATE_STRING + ContinuationToken.SEPARATOR + SIGNATURE); }