public void testHandleLifecycle(Map<String, String> configMap)
throws Exception {
DocumentSnapshot snapshot = getSnapshotUnderTest(configMap);
DocumentHandle handle = snapshot.getUpdate(null);
assertNotNull(handle);
Document doc = handle.getDocument();
assertNotNull(doc);
Set<String> propertyNames = doc.getPropertyNames();
String serialHandle = handle.toString();
DocumentHandle deserialHandle =
new DBHandleFactory().fromString(serialHandle);
assertNotNull(deserialHandle);
assertEquals("document ID",
handle.getDocumentId(), deserialHandle.getDocumentId());
assertJsonEquals("serialization not value preserving",
serialHandle, deserialHandle.toString());
Document recoveryDoc = deserialHandle.getDocument();
assertNotNull(recoveryDoc);
// This is the core assertion, that a document from a deserialized
// handle has the same properties as the original handle from the
// SnapshotRepository.
assertEquals("document from deserialized handle",