-
Notifications
You must be signed in to change notification settings - Fork 7
/
pubsub_nats_mocks_test.go
149 lines (126 loc) · 4.87 KB
/
pubsub_nats_mocks_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
// Code generated by MockGen. DO NOT EDIT.
// Source: pubsub_nats.go
// Package bahamut is a generated GoMock package.
package bahamut
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
nats "github.com/nats-io/nats.go"
)
// MockNATSClient is a mock of natsClient interface.
type MockNATSClient struct {
ctrl *gomock.Controller
recorder *MockNATSClientMockRecorder
}
// MockNATSClientMockRecorder is the mock recorder for MockNATSClient.
type MockNATSClientMockRecorder struct {
mock *MockNATSClient
}
// NewMockNATSClient creates a new mock instance.
func NewMockNATSClient(ctrl *gomock.Controller) *MockNATSClient {
mock := &MockNATSClient{ctrl: ctrl}
mock.recorder = &MockNATSClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockNATSClient) EXPECT() *MockNATSClientMockRecorder {
return m.recorder
}
// Close mocks base method.
func (m *MockNATSClient) Close() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Close")
}
// Close indicates an expected call of Close.
func (mr *MockNATSClientMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockNATSClient)(nil).Close))
}
// Flush mocks base method.
func (m *MockNATSClient) Flush() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Flush")
ret0, _ := ret[0].(error)
return ret0
}
// Flush indicates an expected call of Flush.
func (mr *MockNATSClientMockRecorder) Flush() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Flush", reflect.TypeOf((*MockNATSClient)(nil).Flush))
}
// IsConnected mocks base method.
func (m *MockNATSClient) IsConnected() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsConnected")
ret0, _ := ret[0].(bool)
return ret0
}
// IsConnected indicates an expected call of IsConnected.
func (mr *MockNATSClientMockRecorder) IsConnected() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockNATSClient)(nil).IsConnected))
}
// IsReconnecting mocks base method.
func (m *MockNATSClient) IsReconnecting() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsReconnecting")
ret0, _ := ret[0].(bool)
return ret0
}
// IsReconnecting indicates an expected call of IsReconnecting.
func (mr *MockNATSClientMockRecorder) IsReconnecting() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsReconnecting", reflect.TypeOf((*MockNATSClient)(nil).IsReconnecting))
}
// Publish mocks base method.
func (m *MockNATSClient) Publish(subj string, data []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Publish", subj, data)
ret0, _ := ret[0].(error)
return ret0
}
// Publish indicates an expected call of Publish.
func (mr *MockNATSClientMockRecorder) Publish(subj, data any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockNATSClient)(nil).Publish), subj, data)
}
// QueueSubscribe mocks base method.
func (m *MockNATSClient) QueueSubscribe(subj, queue string, cb nats.MsgHandler) (*nats.Subscription, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "QueueSubscribe", subj, queue, cb)
ret0, _ := ret[0].(*nats.Subscription)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// QueueSubscribe indicates an expected call of QueueSubscribe.
func (mr *MockNATSClientMockRecorder) QueueSubscribe(subj, queue, cb any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueSubscribe", reflect.TypeOf((*MockNATSClient)(nil).QueueSubscribe), subj, queue, cb)
}
// RequestWithContext mocks base method.
func (m *MockNATSClient) RequestWithContext(ctx context.Context, subj string, data []byte) (*nats.Msg, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RequestWithContext", ctx, subj, data)
ret0, _ := ret[0].(*nats.Msg)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// RequestWithContext indicates an expected call of RequestWithContext.
func (mr *MockNATSClientMockRecorder) RequestWithContext(ctx, subj, data any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestWithContext", reflect.TypeOf((*MockNATSClient)(nil).RequestWithContext), ctx, subj, data)
}
// Subscribe mocks base method.
func (m *MockNATSClient) Subscribe(subj string, cb nats.MsgHandler) (*nats.Subscription, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Subscribe", subj, cb)
ret0, _ := ret[0].(*nats.Subscription)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Subscribe indicates an expected call of Subscribe.
func (mr *MockNATSClientMockRecorder) Subscribe(subj, cb any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockNATSClient)(nil).Subscribe), subj, cb)
}