Skip to content

Commit 9458a44

Browse files
---
yaml --- r: 8963 b: refs/heads/lesv-patch-1 c: 24d4067 h: refs/heads/master i: 8961: 2862e32 8959: 830060d
1 parent 8083ab2 commit 9458a44

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ refs/tags/v0.22.0: 18b298fe4bfe8ec2f20b0e0bf7ffdcce5cc3c5fe
6666
refs/heads/vam-google-patch-1: d0c8fee3a4074d0bf7360ce8c4f7f7223d0ee7b9
6767
refs/heads/vam-google-patch-CODEOWNERS: 2ac1616e25229e51d08a984708ef1918f91a35ee
6868
refs/heads/danoscarmike-patch-1: 7342a9916bce4ed00002c7202e2a16c5d46afaea
69-
refs/heads/lesv-patch-1: 3161ab3a49b975f1df57faa7c0c3a0953931d677
69+
refs/heads/lesv-patch-1: 24d4067e4265b097ef4c3b41ecb01810cdd71e40
7070
refs/heads/ml-update-branch: 079dd6610017f5c51b9d1938c12d6d55b61513cf
7171
refs/heads/vkedia-patch-2: 7d8241388a9769a5c069334761b06c7012c878e7
7272
refs/heads/vkedia-patch-3: 4d128043acaa7db9160faf439d2ca6104e8a88cb

branches/lesv-patch-1/google-cloud-firestore/src/test/java/com/google/cloud/firestore/DocumentReferenceTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,26 @@ public void updateWithDotsInFieldName() throws Exception {
592592
assertCommitEquals(expectedCommit, commitCapture.getValue());
593593
}
594594

595+
@Test
596+
public void updateNestedMap() throws Exception {
597+
doReturn(SINGLE_WRITE_COMMIT_RESPONSE)
598+
.when(firestoreMock)
599+
.sendRequest(
600+
commitCapture.capture(), Matchers.<UnaryCallable<CommitRequest, CommitResponse>>any());
601+
602+
documentReference.update("a.b", "foo", "a.c", FieldValue.delete()).get();
603+
604+
Map<String, Value> nestedUpdate = new HashMap<>();
605+
Value.Builder valueProto = Value.newBuilder();
606+
valueProto
607+
.getMapValueBuilder()
608+
.putFields("b", Value.newBuilder().setStringValue("foo").build());
609+
nestedUpdate.put("a", valueProto.build());
610+
611+
CommitRequest expectedCommit = commit(update(nestedUpdate, Arrays.asList("a.b", "a.c")));
612+
assertCommitEquals(expectedCommit, commitCapture.getValue());
613+
}
614+
595615
@Test
596616
public void updateConflictingFields() throws Exception {
597617
try {

0 commit comments

Comments
 (0)