Tests refactored. Tests passed for publish stream in/out.