forked from nikoksr/notify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_fcm_client.go
169 lines (140 loc) · 5.15 KB
/
mock_fcm_client.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
// Code generated by mockery v2.43.2. DO NOT EDIT.
package fcm
import (
context "context"
messaging "firebase.google.com/go/v4/messaging"
mock "github.com/stretchr/testify/mock"
)
// mockfcmClient is an autogenerated mock type for the fcmClient type
type mockfcmClient struct {
mock.Mock
}
type mockfcmClient_Expecter struct {
mock *mock.Mock
}
func (_m *mockfcmClient) EXPECT() *mockfcmClient_Expecter {
return &mockfcmClient_Expecter{mock: &_m.Mock}
}
// Send provides a mock function with given fields: ctx, message
func (_m *mockfcmClient) Send(ctx context.Context, message ...*messaging.Message) (*messaging.BatchResponse, error) {
_va := make([]interface{}, len(message))
for _i := range message {
_va[_i] = message[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Send")
}
var r0 *messaging.BatchResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, ...*messaging.Message) (*messaging.BatchResponse, error)); ok {
return rf(ctx, message...)
}
if rf, ok := ret.Get(0).(func(context.Context, ...*messaging.Message) *messaging.BatchResponse); ok {
r0 = rf(ctx, message...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*messaging.BatchResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, ...*messaging.Message) error); ok {
r1 = rf(ctx, message...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockfcmClient_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
type mockfcmClient_Send_Call struct {
*mock.Call
}
// Send is a helper method to define mock.On call
// - ctx context.Context
// - message ...*messaging.Message
func (_e *mockfcmClient_Expecter) Send(ctx interface{}, message ...interface{}) *mockfcmClient_Send_Call {
return &mockfcmClient_Send_Call{Call: _e.mock.On("Send",
append([]interface{}{ctx}, message...)...)}
}
func (_c *mockfcmClient_Send_Call) Run(run func(ctx context.Context, message ...*messaging.Message)) *mockfcmClient_Send_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]*messaging.Message, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(*messaging.Message)
}
}
run(args[0].(context.Context), variadicArgs...)
})
return _c
}
func (_c *mockfcmClient_Send_Call) Return(_a0 *messaging.BatchResponse, _a1 error) *mockfcmClient_Send_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockfcmClient_Send_Call) RunAndReturn(run func(context.Context, ...*messaging.Message) (*messaging.BatchResponse, error)) *mockfcmClient_Send_Call {
_c.Call.Return(run)
return _c
}
// SendMulticast provides a mock function with given fields: ctx, message
func (_m *mockfcmClient) SendMulticast(ctx context.Context, message *messaging.MulticastMessage) (*messaging.BatchResponse, error) {
ret := _m.Called(ctx, message)
if len(ret) == 0 {
panic("no return value specified for SendMulticast")
}
var r0 *messaging.BatchResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *messaging.MulticastMessage) (*messaging.BatchResponse, error)); ok {
return rf(ctx, message)
}
if rf, ok := ret.Get(0).(func(context.Context, *messaging.MulticastMessage) *messaging.BatchResponse); ok {
r0 = rf(ctx, message)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*messaging.BatchResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *messaging.MulticastMessage) error); ok {
r1 = rf(ctx, message)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockfcmClient_SendMulticast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendMulticast'
type mockfcmClient_SendMulticast_Call struct {
*mock.Call
}
// SendMulticast is a helper method to define mock.On call
// - ctx context.Context
// - message *messaging.MulticastMessage
func (_e *mockfcmClient_Expecter) SendMulticast(ctx interface{}, message interface{}) *mockfcmClient_SendMulticast_Call {
return &mockfcmClient_SendMulticast_Call{Call: _e.mock.On("SendMulticast", ctx, message)}
}
func (_c *mockfcmClient_SendMulticast_Call) Run(run func(ctx context.Context, message *messaging.MulticastMessage)) *mockfcmClient_SendMulticast_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*messaging.MulticastMessage))
})
return _c
}
func (_c *mockfcmClient_SendMulticast_Call) Return(_a0 *messaging.BatchResponse, _a1 error) *mockfcmClient_SendMulticast_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockfcmClient_SendMulticast_Call) RunAndReturn(run func(context.Context, *messaging.MulticastMessage) (*messaging.BatchResponse, error)) *mockfcmClient_SendMulticast_Call {
_c.Call.Return(run)
return _c
}
// newMockfcmClient creates a new instance of mockfcmClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newMockfcmClient(t interface {
mock.TestingT
Cleanup(func())
}) *mockfcmClient {
mock := &mockfcmClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}