More SQL message bus unit tests & refactoring