update unit test to work with asynchronous publishing