Added persistence level for add document task and assertEventually function for integration tests.