Skip to content

Commit d8c6035

Browse files
---
yaml --- r: 8677 b: refs/heads/master c: 24d4067 h: refs/heads/master i: 8675: aed4144
1 parent f4db09a commit d8c6035

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3161ab3a49b975f1df57faa7c0c3a0953931d677
2+
refs/heads/master: 24d4067e4265b097ef4c3b41ecb01810cdd71e40
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 6daca92127d91b7c2c99490080ecf8a13fa94cde
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/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)