forked from yarpc/yarpc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
73 lines (63 loc) · 1.82 KB
/
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
// Code generated by thriftrw-plugin-yarpc
// @generated
package baseservicetest
import (
"context"
"github.com/golang/mock/gomock"
"go.uber.org/yarpc"
"go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/common/baseserviceclient"
)
// MockClient implements a gomock-compatible mock client for service
// BaseService.
type MockClient struct {
ctrl *gomock.Controller
recorder *_MockClientRecorder
}
var _ baseserviceclient.Interface = (*MockClient)(nil)
type _MockClientRecorder struct {
mock *MockClient
}
// Build a new mock client for service BaseService.
//
// mockCtrl := gomock.NewController(t)
// client := baseservicetest.NewMockClient(mockCtrl)
//
// Use EXPECT() to set expectations on the mock.
func NewMockClient(ctrl *gomock.Controller) *MockClient {
mock := &MockClient{ctrl: ctrl}
mock.recorder = &_MockClientRecorder{mock}
return mock
}
// EXPECT returns an object that allows you to define an expectation on the
// BaseService mock client.
func (m *MockClient) EXPECT() *_MockClientRecorder {
return m.recorder
}
// Healthy responds to a Healthy call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().Healthy(gomock.Any(), ...).Return(...)
// ... := client.Healthy(...)
func (m *MockClient) Healthy(
ctx context.Context,
opts ...yarpc.CallOption,
) (success bool, err error) {
args := []interface{}{ctx}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "Healthy", args...)
success, _ = ret[i].(bool)
i++
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) Healthy(
ctx interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "Healthy", args...)
}