@@ -63,7 +63,7 @@ public void testAppliesSetsToDocuments() {
63
63
Document baseDoc = doc ("collection/key" , 0 , data );
64
64
65
65
Mutation set = setMutation ("collection/key" , map ("bar" , "bar-value" ));
66
- MaybeDocument setDoc = set .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
66
+ MaybeDocument setDoc = set .applyToLocalView (baseDoc , Timestamp .now ());
67
67
assertEquals (
68
68
doc ("collection/key" , 0 , map ("bar" , "bar-value" ), Document .DocumentState .LOCAL_MUTATIONS ),
69
69
setDoc );
@@ -75,7 +75,7 @@ public void testAppliesPatchToDocuments() {
75
75
Document baseDoc = doc ("collection/key" , 0 , data );
76
76
77
77
Mutation patch = patchMutation ("collection/key" , map ("foo.bar" , "new-bar-value" ));
78
- MaybeDocument local = patch .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
78
+ MaybeDocument local = patch .applyToLocalView (baseDoc , Timestamp .now ());
79
79
Map <String , Object > expectedData = map ("foo" , map ("bar" , "new-bar-value" ), "baz" , "baz-value" );
80
80
assertEquals (
81
81
doc ("collection/key" , 0 , expectedData , Document .DocumentState .LOCAL_MUTATIONS ), local );
@@ -87,7 +87,7 @@ public void testAppliesPatchWithMergeToDocuments() {
87
87
Mutation upsert =
88
88
mergeMutation (
89
89
"collection/key" , map ("foo.bar" , "new-bar-value" ), Arrays .asList (field ("foo.bar" )));
90
- MaybeDocument newDoc = upsert .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
90
+ MaybeDocument newDoc = upsert .applyToLocalView (baseDoc , Timestamp .now ());
91
91
Map <String , Object > expectedData = map ("foo" , map ("bar" , "new-bar-value" ));
92
92
assertEquals (
93
93
doc ("collection/key" , 0 , expectedData , Document .DocumentState .LOCAL_MUTATIONS ), newDoc );
@@ -99,7 +99,7 @@ public void testAppliesPatchToNullDocWithMergeToDocuments() {
99
99
Mutation upsert =
100
100
mergeMutation (
101
101
"collection/key" , map ("foo.bar" , "new-bar-value" ), Arrays .asList (field ("foo.bar" )));
102
- MaybeDocument newDoc = upsert .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
102
+ MaybeDocument newDoc = upsert .applyToLocalView (baseDoc , Timestamp .now ());
103
103
Map <String , Object > expectedData = map ("foo" , map ("bar" , "new-bar-value" ));
104
104
assertEquals (
105
105
doc ("collection/key" , 0 , expectedData , Document .DocumentState .LOCAL_MUTATIONS ), newDoc );
@@ -114,7 +114,7 @@ public void testDeletesValuesFromTheFieldMask() {
114
114
FieldMask mask = fieldMask ("foo.bar" );
115
115
Mutation patch = new PatchMutation (key , ObjectValue .emptyObject (), mask , Precondition .NONE );
116
116
117
- MaybeDocument patchDoc = patch .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
117
+ MaybeDocument patchDoc = patch .applyToLocalView (baseDoc , Timestamp .now ());
118
118
Map <String , Object > expectedData = map ("foo" , map ("baz" , "baz-value" ));
119
119
assertEquals (
120
120
doc ("collection/key" , 0 , expectedData , Document .DocumentState .LOCAL_MUTATIONS ), patchDoc );
@@ -126,7 +126,7 @@ public void testPatchesPrimitiveValue() {
126
126
Document baseDoc = doc ("collection/key" , 0 , data );
127
127
128
128
Mutation patch = patchMutation ("collection/key" , map ("foo.bar" , "new-bar-value" ));
129
- MaybeDocument patchedDoc = patch .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
129
+ MaybeDocument patchedDoc = patch .applyToLocalView (baseDoc , Timestamp .now ());
130
130
Map <String , Object > expectedData = map ("foo" , map ("bar" , "new-bar-value" ), "baz" , "baz-value" );
131
131
assertEquals (
132
132
doc ("collection/key" , 0 , expectedData , Document .DocumentState .LOCAL_MUTATIONS ), patchedDoc );
@@ -136,7 +136,7 @@ public void testPatchesPrimitiveValue() {
136
136
public void testPatchingDeletedDocumentsDoesNothing () {
137
137
MaybeDocument baseDoc = deletedDoc ("collection/key" , 0 );
138
138
Mutation patch = patchMutation ("collection/key" , map ("foo" , "bar" ));
139
- MaybeDocument patchedDoc = patch .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
139
+ MaybeDocument patchedDoc = patch .applyToLocalView (baseDoc , Timestamp .now ());
140
140
assertEquals (baseDoc , patchedDoc );
141
141
}
142
142
@@ -148,7 +148,7 @@ public void testAppliesLocalServerTimestampTransformsToDocuments() {
148
148
Timestamp timestamp = Timestamp .now ();
149
149
Mutation transform =
150
150
patchMutation ("collection/key" , map ("foo.bar" , FieldValue .serverTimestamp ()));
151
- MaybeDocument transformedDoc = transform .applyToLocalView (baseDoc , baseDoc , timestamp );
151
+ MaybeDocument transformedDoc = transform .applyToLocalView (baseDoc , timestamp );
152
152
153
153
// Server timestamps aren't parsed, so we manually insert it.
154
154
ObjectValue expectedData =
@@ -462,7 +462,7 @@ private void verifyTransform(
462
462
463
463
for (Map <String , Object > transformData : transforms ) {
464
464
PatchMutation transform = patchMutation ("collection/key" , transformData );
465
- currentDoc = transform .applyToLocalView (currentDoc , currentDoc , Timestamp .now ());
465
+ currentDoc = transform .applyToLocalView (currentDoc , Timestamp .now ());
466
466
}
467
467
468
468
Document expectedDoc =
@@ -544,7 +544,7 @@ public void testDeleteDeletes() {
544
544
Document baseDoc = doc ("collection/key" , 0 , data );
545
545
546
546
Mutation delete = deleteMutation ("collection/key" );
547
- MaybeDocument deletedDoc = delete .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
547
+ MaybeDocument deletedDoc = delete .applyToLocalView (baseDoc , Timestamp .now ());
548
548
assertEquals (deletedDoc ("collection/key" , 0 ), deletedDoc );
549
549
}
550
550
@@ -691,8 +691,8 @@ public void testIncrementTwice() {
691
691
Map <String , Object > increment = map ("sum" , FieldValue .increment (1 ));
692
692
Mutation mutation = patchMutation ("collection/key" , increment );
693
693
694
- MaybeDocument mutatedDoc = mutation .applyToLocalView (baseDoc , baseDoc , Timestamp .now ());
695
- mutatedDoc = mutation .applyToLocalView (mutatedDoc , baseDoc , Timestamp .now ());
694
+ MaybeDocument mutatedDoc = mutation .applyToLocalView (baseDoc , Timestamp .now ());
695
+ mutatedDoc = mutation .applyToLocalView (mutatedDoc , Timestamp .now ());
696
696
697
697
assertEquals (wrap (2L ), ((Document ) mutatedDoc ).getField (field ("sum" )));
698
698
}
0 commit comments