fix kafka-tests

This commit is contained in:
programmer10110 2020-11-24 14:11:46 +03:00
parent c53c371c51
commit d36e24307e
1 changed files with 15 additions and 1 deletions

View File

@ -67,8 +67,22 @@ func TestKafkaStorage_SendBatch(t *testing.T) {
N := 10
var offset uint64 = 5
producerCreds := &KafkaAuthCredentials{
Username: "producer",
Password: "producerpass",
}
consumerCreds := &KafkaAuthCredentials{
Username: "consumer",
Password: "consumerpass",
}
tlsConfig, err := GetTLSConfig("../kafka-docker/certs/ca.crt")
if err != nil {
t.Fatal(err.Error())
}
req := require.New(t)
stg, err := NewKafkaStorage(context.Background(), "localhost:9092", "test_topic")
stg, err := NewKafkaStorage(context.Background(), "localhost:9093", "test", tlsConfig, producerCreds, consumerCreds)
req.NoError(err)
msgs := make([]Message, 0, N)