func subscribe(t *testing.T, b broker.Broker, topic string, handle broker.Handler) broker.Subscriber { s, err := b.Subscribe(topic, handle) if err != nil { t.Fatal(err) } return s }
func publish(t *testing.T, b broker.Broker, topic string, msg *broker.Message) { if err := b.Publish(topic, msg); err != nil { t.Fatal(err) } }