Skip to content

Commit b24790e

Browse files
gremi64sduskis
authored andcommitted
---
yaml --- r: 20697 b: refs/heads/autosynth-iamcredentials c: 64f3b2b h: refs/heads/master i: 20695: f1bf883
1 parent 17e6c24 commit b24790e

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ refs/heads/pubsub-ordering-keys: 858d4e986a0ba48e08f00d42f51cbdecb175f5d6
162162
refs/tags/v0.75.0: c3673089ae09a897c1b4cf7dfe167fe4f8ab32fb
163163
refs/tags/v0.76.0: 395b016826d3ddf9cb8b34919636df15a4dbd032
164164
refs/tags/v0.77.0: 28a85a77883ccf5d48f297fd0ef3b3dca6ce01f0
165-
refs/heads/autosynth-iamcredentials: bb2bb7cff5766d2070a8421d902e4af1c9c18bac
165+
refs/heads/autosynth-iamcredentials: 64f3b2be23eab15df420e5890f14409fa52c8411
166166
refs/heads/release-google-cloud-java-v0.78.0: fae5e980779cf0173a152636b278015b9f60ee55
167167
refs/heads/release-google-cloud-java-v0.81.0: 0352cd0dd11f4fd1fbd1ff16e7a96beaccc7b475
168168
refs/heads/release-google-cloud-java-v0.81.1-SNAPSHOT: 5a74ccb1f12506a3b67b65521881298fde20bd6f

branches/autosynth-iamcredentials/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,4 +664,9 @@ public List<WriteResult> apply(CommitResponse commitResponse) {
664664
boolean isEmpty() {
665665
return mutations.isEmpty();
666666
}
667+
668+
/** Get the number of mutations. */
669+
public int getMutationsSize() {
670+
return mutations.size();
671+
}
667672
}

branches/autosynth-iamcredentials/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public void updateDocument() throws Exception {
9191
batch.update(documentReference, updateTime, "foo", "bar");
9292
batch.update(documentReference, LocalFirestoreHelper.SINGLE_FIELD_MAP, updateTime);
9393

94+
assertEquals(4, batch.getMutationsSize());
95+
9496
List<WriteResult> writeResults = batch.commit().get();
9597
List<Write> writes = new ArrayList<>();
9698

@@ -126,6 +128,8 @@ public void setDocument() throws Exception {
126128
writes.add(set(LocalFirestoreHelper.SINGLE_FIELD_PROTO, Arrays.asList("foo")));
127129
writes.add(set(LocalFirestoreHelper.SINGLE_FIELD_PROTO, Arrays.asList("foo")));
128130

131+
assertEquals(4, batch.getMutationsSize());
132+
129133
List<WriteResult> writeResults = batch.commit().get();
130134
for (int i = 0; i < writeResults.size(); ++i) {
131135
assertEquals(Timestamp.ofTimeSecondsAndNanos(i, i), writeResults.get(i).getUpdateTime());
@@ -144,6 +148,8 @@ public void omitWriteResultForDocumentTransforms() throws Exception {
144148

145149
batch.set(documentReference, map("time", FieldValue.serverTimestamp()));
146150

151+
assertEquals(1, batch.getMutationsSize());
152+
147153
List<WriteResult> writeResults = batch.commit().get();
148154
assertEquals(1, writeResults.size());
149155
}
@@ -159,6 +165,8 @@ public void createDocument() throws Exception {
159165
.create(documentReference, LocalFirestoreHelper.SINGLE_FIELD_MAP)
160166
.create(documentReference, LocalFirestoreHelper.SINGLE_FIELD_OBJECT);
161167

168+
assertEquals(2, batch.getMutationsSize());
169+
162170
List<WriteResult> writeResults = batch.commit().get();
163171
List<Write> writes = new ArrayList<>();
164172

@@ -188,6 +196,8 @@ public void deleteDocument() throws Exception {
188196
precondition.getUpdateTimeBuilder().setSeconds(1).setNanos(2);
189197
writes.add(delete(precondition.build()));
190198

199+
assertEquals(2, batch.getMutationsSize());
200+
191201
List<WriteResult> writeResults = batch.commit().get();
192202

193203
for (int i = 0; i < writeResults.size(); ++i) {

0 commit comments

Comments
 (0)