Made the tests work by injecting the cache object into the DbEvent object

This pattern should probably be implemented elsewhere as well.