mirror of https://github.com/status-im/consul.git
111 lines
4.1 KiB
Go
111 lines
4.1 KiB
Go
|
// Code generated by mockery v2.37.1. DO NOT EDIT.
|
||
|
|
||
|
package mockpbserverdiscovery
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
|
||
|
grpc "google.golang.org/grpc"
|
||
|
|
||
|
mock "github.com/stretchr/testify/mock"
|
||
|
|
||
|
pbserverdiscovery "github.com/hashicorp/consul/proto-public/pbserverdiscovery"
|
||
|
)
|
||
|
|
||
|
// ServerDiscoveryServiceClient is an autogenerated mock type for the ServerDiscoveryServiceClient type
|
||
|
type ServerDiscoveryServiceClient struct {
|
||
|
mock.Mock
|
||
|
}
|
||
|
|
||
|
type ServerDiscoveryServiceClient_Expecter struct {
|
||
|
mock *mock.Mock
|
||
|
}
|
||
|
|
||
|
func (_m *ServerDiscoveryServiceClient) EXPECT() *ServerDiscoveryServiceClient_Expecter {
|
||
|
return &ServerDiscoveryServiceClient_Expecter{mock: &_m.Mock}
|
||
|
}
|
||
|
|
||
|
// WatchServers provides a mock function with given fields: ctx, in, opts
|
||
|
func (_m *ServerDiscoveryServiceClient) WatchServers(ctx context.Context, in *pbserverdiscovery.WatchServersRequest, opts ...grpc.CallOption) (pbserverdiscovery.ServerDiscoveryService_WatchServersClient, error) {
|
||
|
_va := make([]interface{}, len(opts))
|
||
|
for _i := range opts {
|
||
|
_va[_i] = opts[_i]
|
||
|
}
|
||
|
var _ca []interface{}
|
||
|
_ca = append(_ca, ctx, in)
|
||
|
_ca = append(_ca, _va...)
|
||
|
ret := _m.Called(_ca...)
|
||
|
|
||
|
var r0 pbserverdiscovery.ServerDiscoveryService_WatchServersClient
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) (pbserverdiscovery.ServerDiscoveryService_WatchServersClient, error)); ok {
|
||
|
return rf(ctx, in, opts...)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) pbserverdiscovery.ServerDiscoveryService_WatchServersClient); ok {
|
||
|
r0 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
if ret.Get(0) != nil {
|
||
|
r0 = ret.Get(0).(pbserverdiscovery.ServerDiscoveryService_WatchServersClient)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) error); ok {
|
||
|
r1 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// ServerDiscoveryServiceClient_WatchServers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchServers'
|
||
|
type ServerDiscoveryServiceClient_WatchServers_Call struct {
|
||
|
*mock.Call
|
||
|
}
|
||
|
|
||
|
// WatchServers is a helper method to define mock.On call
|
||
|
// - ctx context.Context
|
||
|
// - in *pbserverdiscovery.WatchServersRequest
|
||
|
// - opts ...grpc.CallOption
|
||
|
func (_e *ServerDiscoveryServiceClient_Expecter) WatchServers(ctx interface{}, in interface{}, opts ...interface{}) *ServerDiscoveryServiceClient_WatchServers_Call {
|
||
|
return &ServerDiscoveryServiceClient_WatchServers_Call{Call: _e.mock.On("WatchServers",
|
||
|
append([]interface{}{ctx, in}, opts...)...)}
|
||
|
}
|
||
|
|
||
|
func (_c *ServerDiscoveryServiceClient_WatchServers_Call) Run(run func(ctx context.Context, in *pbserverdiscovery.WatchServersRequest, opts ...grpc.CallOption)) *ServerDiscoveryServiceClient_WatchServers_Call {
|
||
|
_c.Call.Run(func(args mock.Arguments) {
|
||
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
||
|
for i, a := range args[2:] {
|
||
|
if a != nil {
|
||
|
variadicArgs[i] = a.(grpc.CallOption)
|
||
|
}
|
||
|
}
|
||
|
run(args[0].(context.Context), args[1].(*pbserverdiscovery.WatchServersRequest), variadicArgs...)
|
||
|
})
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ServerDiscoveryServiceClient_WatchServers_Call) Return(_a0 pbserverdiscovery.ServerDiscoveryService_WatchServersClient, _a1 error) *ServerDiscoveryServiceClient_WatchServers_Call {
|
||
|
_c.Call.Return(_a0, _a1)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ServerDiscoveryServiceClient_WatchServers_Call) RunAndReturn(run func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) (pbserverdiscovery.ServerDiscoveryService_WatchServersClient, error)) *ServerDiscoveryServiceClient_WatchServers_Call {
|
||
|
_c.Call.Return(run)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
// NewServerDiscoveryServiceClient creates a new instance of ServerDiscoveryServiceClient. 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 NewServerDiscoveryServiceClient(t interface {
|
||
|
mock.TestingT
|
||
|
Cleanup(func())
|
||
|
}) *ServerDiscoveryServiceClient {
|
||
|
mock := &ServerDiscoveryServiceClient{}
|
||
|
mock.Mock.Test(t)
|
||
|
|
||
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||
|
|
||
|
return mock
|
||
|
}
|