Improve test coverage

Including PubSub publication flow.