Updated publish event to be more generic.
Added test coverage.