Azure / azure-event-hubs-go

Golang client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
MIT License
88 stars 69 forks source link

Support for mock hub #271

Open atoulme opened 2 years ago

atoulme commented 2 years ago

Expected Behavior

When testing with this library, I want to mock the hub object so I can test its behavior.

Actual Behavior

The Hub object is not easily mockable. There is no interface for it, and the fields are not public, so one cannot instantiate a hub outside of the constructor functions.

See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/12795 for context.