This is an automated email from the ASF dual-hosted git repository. rouazana pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 022d5eae54f661791b2231394b9dcebb21d8d5d5 Author: Gautier DI FOLCO <[email protected]> AuthorDate: Tue May 12 15:41:17 2020 +0200 JAMES-3179 Enable AttachmentAccessTokenTest tests --- .../james/jmap/draft/model/AttachmentAccessTokenTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/AttachmentAccessTokenTest.java b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/AttachmentAccessTokenTest.java index ed1d92f..fdc69b4 100644 --- a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/AttachmentAccessTokenTest.java +++ b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/AttachmentAccessTokenTest.java @@ -35,23 +35,24 @@ public class AttachmentAccessTokenTest { private static final String SIGNATURE = "signature"; @Test - public void getAsStringShouldNotContainBlobId() throws Exception { + public void getAsStringShouldNotContainBlobId() { assertThat(new AttachmentAccessToken(USERNAME, BLOB_ID, EXPIRATION_DATE, SIGNATURE).serialize()) .isEqualTo(USERNAME + AttachmentAccessToken.SEPARATOR + EXPIRATION_DATE_STRING + AttachmentAccessToken.SEPARATOR + SIGNATURE); } @Test - public void getPayloadShouldNotContainBlobId() throws Exception { + public void getPayloadShouldNotContainBlobId() { assertThat(new AttachmentAccessToken(USERNAME, BLOB_ID, EXPIRATION_DATE, SIGNATURE).getPayload()) .isEqualTo(USERNAME + AttachmentAccessToken.SEPARATOR + EXPIRATION_DATE_STRING); } @Test - public void getSignedContentShouldContainBlobId() throws Exception { + public void getSignedContentShouldContainBlobId() { assertThat(new AttachmentAccessToken(USERNAME, BLOB_ID, EXPIRATION_DATE, SIGNATURE).getSignedContent()) .isEqualTo(BLOB_ID + AttachmentAccessToken.SEPARATOR + USERNAME + AttachmentAccessToken.SEPARATOR + EXPIRATION_DATE_STRING); } - + + @Test public void buildWithNullUsernameShouldThrow() { assertThatThrownBy(() -> AttachmentAccessToken.builder() .username(null) @@ -59,6 +60,7 @@ public class AttachmentAccessTokenTest { ).isInstanceOf(NullPointerException.class); } + @Test public void buildWithNullBlobIdShouldThrow() { assertThatThrownBy(() -> AttachmentAccessToken.builder() .username(USERNAME) @@ -67,6 +69,7 @@ public class AttachmentAccessTokenTest { ).isInstanceOf(NullPointerException.class); } + @Test public void buildWithNullExpirationDateShouldThrow() { assertThatThrownBy(() -> AttachmentAccessToken.builder() .username(USERNAME) @@ -76,6 +79,7 @@ public class AttachmentAccessTokenTest { ).isInstanceOf(NullPointerException.class); } + @Test public void buildWithNullSignatureShouldThrow() { assertThatThrownBy(() -> AttachmentAccessToken.builder() .username(USERNAME) @@ -86,6 +90,7 @@ public class AttachmentAccessTokenTest { ).isInstanceOf(NullPointerException.class); } + @Test public void buildWithValidArgumentsShouldBuild() { AttachmentAccessToken expected = new AttachmentAccessToken(USERNAME, BLOB_ID, EXPIRATION_DATE, SIGNATURE); AttachmentAccessToken actual = AttachmentAccessToken.builder() --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
