Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.

Commit 39a23ee

Browse files
author
João Assunção
committed
refactor(encode_decode_test): sends context to method as asked by golangbot
1 parent 4b07f22 commit 39a23ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/kafka/encode_decode_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package kafka
33
import (
44
"context"
55
"encoding/json"
6+
"errors"
67
"sync"
78
"testing"
89
"time"
9-
"errors"
1010

1111
"github.com/Shopify/sarama"
12-
"github.com/stretchr/testify/assert"
1312
e "github.com/inloco/kafka-elasticsearch-injector/src/errors"
13+
"github.com/stretchr/testify/assert"
1414
)
1515

1616
type dummy struct {
@@ -54,7 +54,7 @@ func TestDecoder_JsonMessageToRecord_MalformedJson(t *testing.T) {
5454

5555
func TestDecoder_AvroMessageToRecord_NilMessageValue(t *testing.T) {
5656
d := &Decoder{CodecCache: sync.Map{}}
57-
record, err := d.AvroMessageToRecord(nil, &sarama.ConsumerMessage{Value: nil})
57+
record, err := d.AvroMessageToRecord(context.Background(), &sarama.ConsumerMessage{Value: nil, Topic: "test", Partition: 1, Offset: 54, Timestamp: time.Now()})
5858
isErrNilMessage := errors.Is(err, e.ErrNilMessage)
5959
assert.Nil(t, record)
6060
assert.True(t, isErrNilMessage)

0 commit comments

Comments
 (0)