Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 74d6863

Browse files
committed
Added DatabaseAttachmentTest.testFollowWithRevpos
* Updated couchbase-lite-java-core to pick up the fix for #994 * Added DatabaseAttachmentTest.testFollowWithRevpos
1 parent ba801de commit 74d6863

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/androidTest/java/com/couchbase/lite/DatabaseAttachmentTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,23 @@ public void testGzippedAttachmentByBase64() throws Exception {
801801
assertTrue(Arrays.equals(bytes, receivedBytes));
802802
}
803803

804+
public void testFollowWithRevpos() throws Exception {
805+
Map<String, Object> attachInfo = new HashMap<String, Object>();
806+
attachInfo.put("content_type", "text/plain");
807+
attachInfo.put("digest", "sha1-gOHUOBmIMoDCrMuGyaLWzf1hQTE=");
808+
attachInfo.put("follows", true);
809+
attachInfo.put("length", 27);
810+
attachInfo.put("revpos", 2);
811+
812+
AttachmentInternal attachment = new AttachmentInternal("attachment", attachInfo);
813+
Map<String, Object> stub = attachment.asStubDictionary();
814+
assertEquals(stub.get("content_type"), "text/plain");
815+
assertEquals(stub.get("digest"), "sha1-gOHUOBmIMoDCrMuGyaLWzf1hQTE=");
816+
assertEquals(stub.get("revpos"), 2);
817+
assertEquals(stub.get("stub"), true);
818+
assertNull(stub.get("follows"));
819+
}
820+
804821
private RevisionInternal putDocWithAttachment(String docID, String attachmentText, boolean compress) throws CouchbaseLiteException {
805822
byte[] attachmentData = attachmentText.getBytes();
806823
String encoding = null;

0 commit comments

Comments
 (0)