pubsub: turn PublishResult into an interface, or make it mockable #7801
Labels
api: pubsub
Issues related to the Pub/Sub API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
The exposed PublishResult is available publicly, but can't be manipulated manually, as everything behind it is within an internal package.
While not being able to publish results ourselves makes sense at runtime, it makes writing unit tests quite harder, as we can't mock call our handlers with specific results.
Describe the solution you'd like
I would like to be able to create
PublishResult
structs, and mark them as ready, give them an error and a custom server name.Describe alternatives you've considered
Not having this is kind of preventing writing any unit tests for things that rely on PublishResult, so the only alternative is not having tests.
Additional context
N/A at this stage.
The text was updated successfully, but these errors were encountered: