Documentation ¶
Index ¶
- func AssertCalledHandlerFunc(t *testing.T, h watermillmessage.HandlerFunc, times uint32, ...) (handler watermillmessage.HandlerFunc, done chan struct{})
- func NewRouter(t *testing.T) *watermillmessage.Router
- func NewRouterWithLogs(t *testing.T, logger *logrus.Logger) *watermillmessage.Router
- func ReliablePublisher(t *testing.T, topic string, messagesToAssert int, timeout time.Duration) (publisher *gochannel.GoChannel, done chan struct{})
- type NoopPublisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCalledHandlerFunc ¶
func AssertCalledHandlerFunc(t *testing.T, h watermillmessage.HandlerFunc, times uint32, timeout time.Duration) (handler watermillmessage.HandlerFunc, done chan struct{})
AssertCalledHandlerFunc returns a new HandlerFunc based on a given one that will make the test fail if the given handler has not been called at least `times` before a given timeout.
func NewRouter ¶
func NewRouter(t *testing.T) *watermillmessage.Router
NewRouter creates a watermillmessage.Router with some needed test cleanup actions.
func NewRouterWithLogs ¶
NewRouterWithLogs creates a watermillmessage.Router with some needed test cleanup actions. It also configures a logger.
func ReliablePublisher ¶
func ReliablePublisher(t *testing.T, topic string, messagesToAssert int, timeout time.Duration) (publisher *gochannel.GoChannel, done chan struct{})
ReliablePublisher creates a publisher with a subscriber that will make the test fail if the number of published messages does not reach `messagesToAssert` before a given timeout. Should be only used on tests.
Types ¶
type NoopPublisher ¶
type NoopPublisher struct{}
NoopPublisher is a publisher that publishes nothing. Implements watermillmessage.Publisher interface.
func (NoopPublisher) Close ¶
func (n NoopPublisher) Close() error
func (NoopPublisher) Publish ¶
func (n NoopPublisher) Publish(_ string, _ ...*watermillmessage.Message) error