consul/internal/tools/protoc-gen-grpc-clone/e2e/mock_SimpleClient_test.go

181 lines
5.4 KiB
Go
Raw Normal View History

// Code generated by mockery v2.37.1. DO NOT EDIT.
package e2e
import (
context "context"
grpc "google.golang.org/grpc"
mock "github.com/stretchr/testify/mock"
proto "github.com/hashicorp/consul/internal/tools/protoc-gen-grpc-clone/e2e/proto"
)
// SimpleClient is an autogenerated mock type for the SimpleClient type
type SimpleClient struct {
mock.Mock
}
type SimpleClient_Expecter struct {
mock *mock.Mock
}
func (_m *SimpleClient) EXPECT() *SimpleClient_Expecter {
return &SimpleClient_Expecter{mock: &_m.Mock}
}
// Flow provides a mock function with given fields: ctx, in, opts
func (_m *SimpleClient) Flow(ctx context.Context, in *proto.Req, opts ...grpc.CallOption) (proto.Simple_FlowClient, 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 proto.Simple_FlowClient
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *proto.Req, ...grpc.CallOption) (proto.Simple_FlowClient, error)); ok {
return rf(ctx, in, opts...)
}
if rf, ok := ret.Get(0).(func(context.Context, *proto.Req, ...grpc.CallOption) proto.Simple_FlowClient); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(proto.Simple_FlowClient)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *proto.Req, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SimpleClient_Flow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flow'
type SimpleClient_Flow_Call struct {
*mock.Call
}
// Flow is a helper method to define mock.On call
// - ctx context.Context
// - in *proto.Req
// - opts ...grpc.CallOption
func (_e *SimpleClient_Expecter) Flow(ctx interface{}, in interface{}, opts ...interface{}) *SimpleClient_Flow_Call {
return &SimpleClient_Flow_Call{Call: _e.mock.On("Flow",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *SimpleClient_Flow_Call) Run(run func(ctx context.Context, in *proto.Req, opts ...grpc.CallOption)) *SimpleClient_Flow_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].(*proto.Req), variadicArgs...)
})
return _c
}
func (_c *SimpleClient_Flow_Call) Return(_a0 proto.Simple_FlowClient, _a1 error) *SimpleClient_Flow_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *SimpleClient_Flow_Call) RunAndReturn(run func(context.Context, *proto.Req, ...grpc.CallOption) (proto.Simple_FlowClient, error)) *SimpleClient_Flow_Call {
_c.Call.Return(run)
return _c
}
// Something provides a mock function with given fields: ctx, in, opts
func (_m *SimpleClient) Something(ctx context.Context, in *proto.Req, opts ...grpc.CallOption) (*proto.Resp, 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 *proto.Resp
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *proto.Req, ...grpc.CallOption) (*proto.Resp, error)); ok {
return rf(ctx, in, opts...)
}
if rf, ok := ret.Get(0).(func(context.Context, *proto.Req, ...grpc.CallOption) *proto.Resp); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*proto.Resp)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *proto.Req, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SimpleClient_Something_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Something'
type SimpleClient_Something_Call struct {
*mock.Call
}
// Something is a helper method to define mock.On call
// - ctx context.Context
// - in *proto.Req
// - opts ...grpc.CallOption
func (_e *SimpleClient_Expecter) Something(ctx interface{}, in interface{}, opts ...interface{}) *SimpleClient_Something_Call {
return &SimpleClient_Something_Call{Call: _e.mock.On("Something",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *SimpleClient_Something_Call) Run(run func(ctx context.Context, in *proto.Req, opts ...grpc.CallOption)) *SimpleClient_Something_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].(*proto.Req), variadicArgs...)
})
return _c
}
func (_c *SimpleClient_Something_Call) Return(_a0 *proto.Resp, _a1 error) *SimpleClient_Something_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *SimpleClient_Something_Call) RunAndReturn(run func(context.Context, *proto.Req, ...grpc.CallOption) (*proto.Resp, error)) *SimpleClient_Something_Call {
_c.Call.Return(run)
return _c
}
// NewSimpleClient creates a new instance of SimpleClient. 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 NewSimpleClient(t interface {
mock.TestingT
Cleanup(func())
}) *SimpleClient {
mock := &SimpleClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}