-
Notifications
You must be signed in to change notification settings - Fork 3
/
mock.go
81 lines (67 loc) · 2.57 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package mock
import (
"context"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc"
"github.com/SKF/go-eventsource/eventsource"
iam_grpcapi "github.com/SKF/proto/iam"
"github.com/SKF/go-enlight-sdk/services/iam"
)
type client struct {
mock.Mock
}
func Create() *client { // nolint: golint
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) DialWithContext(ctx context.Context, host, port string, opts ...grpc.DialOption) error {
args := mock.Called(ctx, host, port, opts)
return args.Error(0)
}
func (mock *client) Close() {
mock.Called()
}
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, arn string) (iam_grpcapi.UserClaims, error) {
args := mock.Called(token, arn)
return args.Get(0).(iam_grpcapi.UserClaims), args.Error(1)
}
func (mock *client) CheckAuthenticationWithContext(ctx context.Context, token, arn string) (iam_grpcapi.UserClaims, error) {
args := mock.Called(ctx, token, arn)
return args.Get(0).(iam_grpcapi.UserClaims), args.Error(1)
}
func (mock *client) CheckAuthenticationByEndpoint(token, api, method, endpoint string) (iam_grpcapi.UserClaims, error) {
args := mock.Called(token, api, method, endpoint)
return args.Get(0).(iam_grpcapi.UserClaims), args.Error(1)
}
func (mock *client) CheckAuthenticationByEndpointWithContext(ctx context.Context, token, api, method, endpoint string) (iam_grpcapi.UserClaims, error) {
args := mock.Called(ctx, token, api, method, endpoint)
return args.Get(0).(iam_grpcapi.UserClaims), 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)
}