-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathbatched_stream_reader_mock_test.go
267 lines (225 loc) · 10.2 KB
/
batched_stream_reader_mock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// Code generated by MockGen. DO NOT EDIT.
// Source: batched_stream_reader_interface.go
//
// Generated by this command:
//
// mockgen -source batched_stream_reader_interface.go --typed -destination batched_stream_reader_mock_test.go -package topicreaderinternal -write_package_comment=false
package topicreaderinternal
import (
context "context"
reflect "reflect"
topicreadercommon "github.com/ydb-platform/ydb-go-sdk/v3/internal/topic/topicreadercommon"
tx "github.com/ydb-platform/ydb-go-sdk/v3/internal/tx"
gomock "go.uber.org/mock/gomock"
)
// MockbatchedStreamReader is a mock of batchedStreamReader interface.
type MockbatchedStreamReader struct {
ctrl *gomock.Controller
recorder *MockbatchedStreamReaderMockRecorder
}
// MockbatchedStreamReaderMockRecorder is the mock recorder for MockbatchedStreamReader.
type MockbatchedStreamReaderMockRecorder struct {
mock *MockbatchedStreamReader
}
// NewMockbatchedStreamReader creates a new mock instance.
func NewMockbatchedStreamReader(ctrl *gomock.Controller) *MockbatchedStreamReader {
mock := &MockbatchedStreamReader{ctrl: ctrl}
mock.recorder = &MockbatchedStreamReaderMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockbatchedStreamReader) EXPECT() *MockbatchedStreamReaderMockRecorder {
return m.recorder
}
// CloseWithError mocks base method.
func (m *MockbatchedStreamReader) CloseWithError(ctx context.Context, err error) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseWithError", ctx, err)
ret0, _ := ret[0].(error)
return ret0
}
// CloseWithError indicates an expected call of CloseWithError.
func (mr *MockbatchedStreamReaderMockRecorder) CloseWithError(ctx, err any) *MockbatchedStreamReaderCloseWithErrorCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseWithError", reflect.TypeOf((*MockbatchedStreamReader)(nil).CloseWithError), ctx, err)
return &MockbatchedStreamReaderCloseWithErrorCall{Call: call}
}
// MockbatchedStreamReaderCloseWithErrorCall wrap *gomock.Call
type MockbatchedStreamReaderCloseWithErrorCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderCloseWithErrorCall) Return(arg0 error) *MockbatchedStreamReaderCloseWithErrorCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderCloseWithErrorCall) Do(f func(context.Context, error) error) *MockbatchedStreamReaderCloseWithErrorCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderCloseWithErrorCall) DoAndReturn(f func(context.Context, error) error) *MockbatchedStreamReaderCloseWithErrorCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Commit mocks base method.
func (m *MockbatchedStreamReader) Commit(ctx context.Context, commitRange topicreadercommon.CommitRange) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Commit", ctx, commitRange)
ret0, _ := ret[0].(error)
return ret0
}
// Commit indicates an expected call of Commit.
func (mr *MockbatchedStreamReaderMockRecorder) Commit(ctx, commitRange any) *MockbatchedStreamReaderCommitCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockbatchedStreamReader)(nil).Commit), ctx, commitRange)
return &MockbatchedStreamReaderCommitCall{Call: call}
}
// MockbatchedStreamReaderCommitCall wrap *gomock.Call
type MockbatchedStreamReaderCommitCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderCommitCall) Return(arg0 error) *MockbatchedStreamReaderCommitCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderCommitCall) Do(f func(context.Context, topicreadercommon.CommitRange) error) *MockbatchedStreamReaderCommitCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderCommitCall) DoAndReturn(f func(context.Context, topicreadercommon.CommitRange) error) *MockbatchedStreamReaderCommitCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// PopMessagesBatchTx mocks base method.
func (m *MockbatchedStreamReader) PopMessagesBatchTx(ctx context.Context, tx tx.Transaction, opts ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PopMessagesBatchTx", ctx, tx, opts)
ret0, _ := ret[0].(*topicreadercommon.PublicBatch)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PopMessagesBatchTx indicates an expected call of PopMessagesBatchTx.
func (mr *MockbatchedStreamReaderMockRecorder) PopMessagesBatchTx(ctx, tx, opts any) *MockbatchedStreamReaderPopMessagesBatchTxCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PopMessagesBatchTx", reflect.TypeOf((*MockbatchedStreamReader)(nil).PopMessagesBatchTx), ctx, tx, opts)
return &MockbatchedStreamReaderPopMessagesBatchTxCall{Call: call}
}
// MockbatchedStreamReaderPopMessagesBatchTxCall wrap *gomock.Call
type MockbatchedStreamReaderPopMessagesBatchTxCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderPopMessagesBatchTxCall) Return(arg0 *topicreadercommon.PublicBatch, arg1 error) *MockbatchedStreamReaderPopMessagesBatchTxCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderPopMessagesBatchTxCall) Do(f func(context.Context, tx.Transaction, ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error)) *MockbatchedStreamReaderPopMessagesBatchTxCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderPopMessagesBatchTxCall) DoAndReturn(f func(context.Context, tx.Transaction, ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error)) *MockbatchedStreamReaderPopMessagesBatchTxCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// ReadMessageBatch mocks base method.
func (m *MockbatchedStreamReader) ReadMessageBatch(ctx context.Context, opts ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ReadMessageBatch", ctx, opts)
ret0, _ := ret[0].(*topicreadercommon.PublicBatch)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ReadMessageBatch indicates an expected call of ReadMessageBatch.
func (mr *MockbatchedStreamReaderMockRecorder) ReadMessageBatch(ctx, opts any) *MockbatchedStreamReaderReadMessageBatchCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadMessageBatch", reflect.TypeOf((*MockbatchedStreamReader)(nil).ReadMessageBatch), ctx, opts)
return &MockbatchedStreamReaderReadMessageBatchCall{Call: call}
}
// MockbatchedStreamReaderReadMessageBatchCall wrap *gomock.Call
type MockbatchedStreamReaderReadMessageBatchCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderReadMessageBatchCall) Return(arg0 *topicreadercommon.PublicBatch, arg1 error) *MockbatchedStreamReaderReadMessageBatchCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderReadMessageBatchCall) Do(f func(context.Context, ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error)) *MockbatchedStreamReaderReadMessageBatchCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderReadMessageBatchCall) DoAndReturn(f func(context.Context, ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error)) *MockbatchedStreamReaderReadMessageBatchCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// TopicOnReaderStart mocks base method.
func (m *MockbatchedStreamReader) TopicOnReaderStart(consumer string, err error) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "TopicOnReaderStart", consumer, err)
}
// TopicOnReaderStart indicates an expected call of TopicOnReaderStart.
func (mr *MockbatchedStreamReaderMockRecorder) TopicOnReaderStart(consumer, err any) *MockbatchedStreamReaderTopicOnReaderStartCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TopicOnReaderStart", reflect.TypeOf((*MockbatchedStreamReader)(nil).TopicOnReaderStart), consumer, err)
return &MockbatchedStreamReaderTopicOnReaderStartCall{Call: call}
}
// MockbatchedStreamReaderTopicOnReaderStartCall wrap *gomock.Call
type MockbatchedStreamReaderTopicOnReaderStartCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderTopicOnReaderStartCall) Return() *MockbatchedStreamReaderTopicOnReaderStartCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderTopicOnReaderStartCall) Do(f func(string, error)) *MockbatchedStreamReaderTopicOnReaderStartCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderTopicOnReaderStartCall) DoAndReturn(f func(string, error)) *MockbatchedStreamReaderTopicOnReaderStartCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// WaitInit mocks base method.
func (m *MockbatchedStreamReader) WaitInit(ctx context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitInit", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// WaitInit indicates an expected call of WaitInit.
func (mr *MockbatchedStreamReaderMockRecorder) WaitInit(ctx any) *MockbatchedStreamReaderWaitInitCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitInit", reflect.TypeOf((*MockbatchedStreamReader)(nil).WaitInit), ctx)
return &MockbatchedStreamReaderWaitInitCall{Call: call}
}
// MockbatchedStreamReaderWaitInitCall wrap *gomock.Call
type MockbatchedStreamReaderWaitInitCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockbatchedStreamReaderWaitInitCall) Return(arg0 error) *MockbatchedStreamReaderWaitInitCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockbatchedStreamReaderWaitInitCall) Do(f func(context.Context) error) *MockbatchedStreamReaderWaitInitCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockbatchedStreamReaderWaitInitCall) DoAndReturn(f func(context.Context) error) *MockbatchedStreamReaderWaitInitCall {
c.Call = c.Call.DoAndReturn(f)
return c
}