You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/04/22 02:31:58 UTC
[james-project] 18/37: JAMES-2997 Renable BlobTest
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 5ed32bfca007aa9944eebcc774b0b5d2fcfc62dc
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jan 17 16:44:35 2020 +0700
JAMES-2997 Renable BlobTest
---
.../java/org/apache/james/mailbox/model/BlobTest.java | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/model/BlobTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/model/BlobTest.java
index 32e87e0..55c3b3c 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/model/BlobTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/model/BlobTest.java
@@ -22,17 +22,19 @@ package org.apache.james.mailbox.model;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
+import org.apache.james.mailbox.model.Blob.InputStreamSupplier;
import org.junit.jupiter.api.Test;
import nl.jqno.equalsverifier.EqualsVerifier;
class BlobTest {
-
- public static final BlobId ID = BlobId.fromString("123");
- public static final String CONTENT_TYPE = "text/plain";
- public static final byte[] PAYLOAD = "abc".getBytes(StandardCharsets.UTF_8);
+ static final BlobId ID = BlobId.fromString("123");
+ static final String CONTENT_TYPE = "text/plain";
+ static final InputStreamSupplier PAYLOAD = () -> new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8));
+ static final int LENGTH = 3;
@Test
void shouldMatchBeanContract() {
@@ -40,7 +42,7 @@ class BlobTest {
.withIgnoredFields("payload", "size")
.verify();
}
-/*
+
@Test
void buildShouldConstructValidBlob() {
assertThat(
@@ -48,9 +50,10 @@ class BlobTest {
.id(ID)
.contentType(CONTENT_TYPE)
.payload(PAYLOAD)
+ .size(LENGTH)
.build())
.isEqualTo(
- new Blob(ID, PAYLOAD, CONTENT_TYPE, length));
+ new Blob(ID, PAYLOAD, CONTENT_TYPE, LENGTH));
}
@Test
@@ -81,5 +84,5 @@ class BlobTest {
.contentType(CONTENT_TYPE)
.build())
.isInstanceOf(IllegalStateException.class);
- }*/
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org