AttachmentAccessToken implements SignedExpiringToken { @Override public String getSignedContent() { return blobId + SEPARATOR + getPayload(); } @VisibleForTesting  AttachmentAccessToken(String username, String blobId, ZonedDateTime expirationDate, String signature); static Builder builder(); static AttachmentAccessToken from(String serializedAttachmentAccessToken, String blobId); String getBlobId(); 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 getSignedContentShouldContainBlobId() { assertThat(new AttachmentAccessToken(USERNAME, BLOB_ID, EXPIRATION_DATE, SIGNATURE).getSignedContent()) .isEqualTo(BLOB_ID + AttachmentAccessToken.SEPARATOR + USERNAME + AttachmentAccessToken.SEPARATOR + EXPIRATION_DATE_STRING); }