use of com.google.cloud.firestore.FieldValue in project java-firestore by googleapis.
the class ITSystemTest method mergeDocumentWithServerTimestamp.
@Test
public void mergeDocumentWithServerTimestamp() throws Exception {
Map<String, Object> originalMap = LocalFirestoreHelper.map("a", "b");
Map<String, FieldValue> updateMap = map("c", FieldValue.serverTimestamp());
randomDoc.set(originalMap).get();
randomDoc.set(updateMap, SetOptions.merge()).get();
DocumentSnapshot documentSnapshot = randomDoc.get().get();
assertEquals("b", documentSnapshot.getString("a"));
assertNotNull(documentSnapshot.getDate("c"));
}
Aggregations