Is there a way to test/mock sarama-cluster's NewConsumer function without having actual brokers set up? What am I missing here?
Code I'm trying to test:
import cluster "github.com/bsm/sarama-cluster"
func initSaramaConsumer() (*cluster.Consumer, error) {
brokers := []string{"some_url:port"}
groups := "some_group"
topics := []string{"some_topic"}
config := cluster.NewConfig()
saramaConsumer, err := cluster.NewConsumer(
brokers, groups, topics, config,
)
if err != nil {
return nil, err
}
return saramaConsumer, nil
}