-
Notifications
You must be signed in to change notification settings - Fork 13
/
fcm.go
60 lines (41 loc) · 1.77 KB
/
fcm.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
package mocks
import (
"context"
"firebase.google.com/go/messaging"
"github.com/stretchr/testify/mock"
)
type FakeFCM struct {
mock.Mock
}
func (f *FakeFCM) Send(_ context.Context, message *messaging.Message) (string, error) {
args := f.Called(message)
return args.String(0), args.Error(1)
}
func (f *FakeFCM) SendDryRun(_ context.Context, message *messaging.Message) (string, error) {
args := f.Called(message)
return args.String(0), args.Error(1)
}
func (f *FakeFCM) SendAll(_ context.Context, messages []*messaging.Message) (*messaging.BatchResponse, error) {
args := f.Called(messages)
return args.Get(0).(*messaging.BatchResponse), args.Error(1)
}
func (f *FakeFCM) SendAllDryRun(_ context.Context, messages []*messaging.Message) (*messaging.BatchResponse, error) {
args := f.Called(messages)
return args.Get(0).(*messaging.BatchResponse), args.Error(1)
}
func (f *FakeFCM) SendMulticast(_ context.Context, message *messaging.MulticastMessage) (*messaging.BatchResponse, error) {
args := f.Called(message)
return args.Get(0).(*messaging.BatchResponse), args.Error(1)
}
func (f *FakeFCM) SendMulticastDryRun(_ context.Context, message *messaging.MulticastMessage) (*messaging.BatchResponse, error) {
args := f.Called(message)
return args.Get(0).(*messaging.BatchResponse), args.Error(1)
}
func (f *FakeFCM) SubscribeToTopic(_ context.Context, tokens []string, topic string) (*messaging.TopicManagementResponse, error) {
args := f.Called(tokens, topic)
return args.Get(0).(*messaging.TopicManagementResponse), args.Error(1)
}
func (f *FakeFCM) UnsubscribeFromTopic(_ context.Context, tokens []string, topic string) (*messaging.TopicManagementResponse, error) {
args := f.Called(tokens, topic)
return args.Get(0).(*messaging.TopicManagementResponse), args.Error(1)
}