-
Notifications
You must be signed in to change notification settings - Fork 3
/
mock.go
67 lines (56 loc) · 1.88 KB
/
mock.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
package mock
import (
"context"
"github.com/SKF/go-eventsource/eventsource"
iam_grpcapi "github.com/SKF/proto/iam"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc"
"github.com/SKF/go-enlight-sdk/services/iam"
)
type client struct {
mock.Mock
}
func Create() *client {
return new(client)
}
var _ iam.IAMClient = &client{}
func (mock *client) Dial(host, port string, opts ...grpc.DialOption) error {
args := mock.Called(host, port, opts)
return args.Error(0)
}
func (mock *client) Close() {
mock.Called()
return
}
func (mock *client) DeepPing() error {
args := mock.Called()
return args.Error(0)
}
func (mock *client) DeepPingWithContext(ctx context.Context) error {
args := mock.Called(ctx)
return args.Error(0)
}
func (mock *client) CheckAuthentication(token, method string) (iam_grpcapi.User, error) {
args := mock.Called(token, method)
return args.Get(0).(iam_grpcapi.User), args.Error(1)
}
func (mock *client) CheckAuthenticationWithContext(ctx context.Context, token, method string) (iam_grpcapi.User, error) {
args := mock.Called(ctx, token, method)
return args.Get(0).(iam_grpcapi.User), args.Error(1)
}
func (mock *client) GetNodesByUser(userID string) (nodeIDs []string, err error) {
args := mock.Called(userID)
return args.Get(0).([]string), args.Error(1)
}
func (mock *client) GetNodesByUserWithContext(ctx context.Context, userID string) (nodeIDs []string, err error) {
args := mock.Called(ctx, userID)
return args.Get(0).([]string), args.Error(1)
}
func (mock *client) GetEventRecords(since int, limit *int32) ([]eventsource.Record, error) {
args := mock.Called(since, limit)
return args.Get(0).([]eventsource.Record), args.Error(1)
}
func (mock *client) GetEventRecordsWithContext(ctx context.Context, since int, limit *int32) ([]eventsource.Record, error) {
args := mock.Called(ctx, since, limit)
return args.Get(0).([]eventsource.Record), args.Error(1)
}