Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/Shopify/sarama: use sarama.MinVersion in tests. #761

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions contrib/Shopify/sarama/sarama_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ func TestConsumer(t *testing.T) {
SetMessage("test-topic", 0, 0, sarama.StringEncoder("hello")).
SetMessage("test-topic", 0, 1, sarama.StringEncoder("world")),
})

client, err := sarama.NewClient([]string{broker.Addr()}, sarama.NewConfig())
cfg := sarama.NewConfig()
cfg.Version = sarama.MinVersion
client, err := sarama.NewClient([]string{broker.Addr()}, cfg)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -113,6 +114,7 @@ func TestSyncProducer(t *testing.T) {
leader.Returns(prodSuccess)

cfg := sarama.NewConfig()
cfg.Version = sarama.MinVersion
cfg.Producer.Return.Successes = true

producer, err := sarama.NewSyncProducer([]string{seedBroker.Addr()}, cfg)
Expand Down Expand Up @@ -160,6 +162,7 @@ func TestSyncProducerSendMessages(t *testing.T) {
leader.Returns(prodSuccess)

cfg := sarama.NewConfig()
cfg.Version = sarama.MinVersion
cfg.Producer.Return.Successes = true
cfg.Producer.Flush.Messages = 2

Expand Down Expand Up @@ -200,7 +203,9 @@ func TestAsyncProducer(t *testing.T) {

broker := newMockBroker(t)

producer, err := sarama.NewAsyncProducer([]string{broker.Addr()}, nil)
cfg := sarama.NewConfig()
cfg.Version = sarama.MinVersion
producer, err := sarama.NewAsyncProducer([]string{broker.Addr()}, cfg)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -234,6 +239,7 @@ func TestAsyncProducer(t *testing.T) {
broker := newMockBroker(t)

cfg := sarama.NewConfig()
cfg.Version = sarama.MinVersion
cfg.Producer.Return.Successes = true

producer, err := sarama.NewAsyncProducer([]string{broker.Addr()}, cfg)
Expand Down