Revert "[VOL-3069]Pass Context in methods which are performing logging and need the context"
This reverts commit 3c425fbeabed17ec8dad437678b4d105deaf2fbe.
Reason for revert: Merging higher-priority patches first.
Change-Id: Iaa03a5977357dcd86de358d76e90cc54cd6b1fa5
diff --git a/pkg/mocks/kafka/kafka_client_test.go b/pkg/mocks/kafka/kafka_client_test.go
index 7753d66..0e35ec1 100644
--- a/pkg/mocks/kafka/kafka_client_test.go
+++ b/pkg/mocks/kafka/kafka_client_test.go
@@ -17,35 +17,34 @@
package kafka
import (
- "context"
+ "testing"
+ "time"
+
"github.com/opencord/voltha-lib-go/v3/pkg/kafka"
ic "github.com/opencord/voltha-protos/v3/go/inter_container"
"github.com/stretchr/testify/assert"
- "testing"
- "time"
)
func TestKafkaClientCreateTopic(t *testing.T) {
- ctx := context.Background()
cTkc := NewKafkaClient()
topic := kafka.Topic{Name: "myTopic"}
- err := cTkc.CreateTopic(ctx, &topic, 1, 1)
+ err := cTkc.CreateTopic(&topic, 1, 1)
assert.Nil(t, err)
- err = cTkc.CreateTopic(ctx, &topic, 1, 1)
+ err = cTkc.CreateTopic(&topic, 1, 1)
assert.NotNil(t, err)
}
func TestKafkaClientDeleteTopic(t *testing.T) {
cTkc := NewKafkaClient()
topic := kafka.Topic{Name: "myTopic"}
- err := cTkc.DeleteTopic(context.Background(), &topic)
+ err := cTkc.DeleteTopic(&topic)
assert.Nil(t, err)
}
func TestKafkaClientSubscribeSend(t *testing.T) {
cTkc := NewKafkaClient()
topic := kafka.Topic{Name: "myTopic"}
- ch, err := cTkc.Subscribe(context.Background(), &topic)
+ ch, err := cTkc.Subscribe(&topic)
assert.Nil(t, err)
assert.NotNil(t, ch)
testCh := make(chan bool)
@@ -66,7 +65,7 @@
testCh <- false
}
}()
- err = cTkc.Send(context.Background(), msg, &topic)
+ err = cTkc.Send(msg, &topic)
assert.Nil(t, err)
res := <-testCh
assert.True(t, res)
@@ -75,20 +74,20 @@
func TestKafkaClientUnSubscribe(t *testing.T) {
cTkc := NewKafkaClient()
topic := kafka.Topic{Name: "myTopic"}
- ch, err := cTkc.Subscribe(context.Background(), &topic)
+ ch, err := cTkc.Subscribe(&topic)
assert.Nil(t, err)
assert.NotNil(t, ch)
- err = cTkc.UnSubscribe(context.Background(), &topic, ch)
+ err = cTkc.UnSubscribe(&topic, ch)
assert.Nil(t, err)
}
func TestKafkaClientStop(t *testing.T) {
cTkc := NewKafkaClient()
topic := kafka.Topic{Name: "myTopic"}
- ch, err := cTkc.Subscribe(context.Background(), &topic)
+ ch, err := cTkc.Subscribe(&topic)
assert.Nil(t, err)
assert.NotNil(t, ch)
- err = cTkc.UnSubscribe(context.Background(), &topic, ch)
+ err = cTkc.UnSubscribe(&topic, ch)
assert.Nil(t, err)
- cTkc.Stop(context.Background())
+ cTkc.Stop()
}