@@ -11,17 +11,17 @@ import (
11
11
"github.com/stretchr/testify/mock"
12
12
)
13
13
14
- // MockKafkaWriter is a mock for kafka.Writer
15
- type MockKafkaWriter struct {
14
+ // mockKafkaWriter is a mock for kafka.Writer
15
+ type mockKafkaWriter struct {
16
16
mock.Mock
17
17
}
18
18
19
- func (m * MockKafkaWriter ) WriteMessages (ctx context.Context , msgs ... kafka.Message ) error {
19
+ func (m * mockKafkaWriter ) WriteMessages (ctx context.Context , msgs ... kafka.Message ) error {
20
20
args := m .Called (ctx , msgs )
21
21
return args .Error (0 )
22
22
}
23
23
24
- func (m * MockKafkaWriter ) Close () error {
24
+ func (m * mockKafkaWriter ) Close () error {
25
25
args := m .Called ()
26
26
return args .Error (0 )
27
27
}
@@ -66,7 +66,7 @@ func TestNewPusher(t *testing.T) {
66
66
}
67
67
68
68
func TestPusher_Close (t * testing.T ) {
69
- mockWriter := new (MockKafkaWriter )
69
+ mockWriter := new (mockKafkaWriter )
70
70
pusher := & Pusher {
71
71
producer : mockWriter ,
72
72
}
@@ -86,7 +86,7 @@ func TestPusher_Name(t *testing.T) {
86
86
}
87
87
88
88
func TestPusher_Push (t * testing.T ) {
89
- mockWriter := new (MockKafkaWriter )
89
+ mockWriter := new (mockKafkaWriter )
90
90
pusher := & Pusher {
91
91
producer : mockWriter ,
92
92
topic : "test-topic" ,
@@ -103,7 +103,7 @@ func TestPusher_Push(t *testing.T) {
103
103
}
104
104
105
105
func TestPusher_PushWithKey (t * testing.T ) {
106
- mockWriter := new (MockKafkaWriter )
106
+ mockWriter := new (mockKafkaWriter )
107
107
pusher := & Pusher {
108
108
producer : mockWriter ,
109
109
topic : "test-topic" ,
@@ -121,7 +121,7 @@ func TestPusher_PushWithKey(t *testing.T) {
121
121
}
122
122
123
123
func TestPusher_PushWithKey_Error (t * testing.T ) {
124
- mockWriter := new (MockKafkaWriter )
124
+ mockWriter := new (mockKafkaWriter )
125
125
pusher := & Pusher {
126
126
producer : mockWriter ,
127
127
topic : "test-topic" ,
0 commit comments