when(documents.findAndRemove(any(DBObject.class))).thenReturn(mongoObject);
// Add some content since markProcessed assumes content exists.
document.putContentField("a", "b");
when(oldDocuments.insert(any(DBObject.class))).thenThrow(new MongoInternalException(
"I am suck!"));
boolean processed = documentIO.markProcessed(document, "Test stage");
assertFalse("Processing should not be fine", processed);