mirror of https://github.com/hashicorp/consul
181 lines
5.6 KiB
Go
181 lines
5.6 KiB
Go
|
// Code generated by mockery v2.37.1. DO NOT EDIT.
|
||
|
|
||
|
package mockpbacl
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
|
||
|
grpc "google.golang.org/grpc"
|
||
|
|
||
|
mock "github.com/stretchr/testify/mock"
|
||
|
|
||
|
pbacl "github.com/hashicorp/consul/proto-public/pbacl"
|
||
|
)
|
||
|
|
||
|
// ACLServiceClient is an autogenerated mock type for the ACLServiceClient type
|
||
|
type ACLServiceClient struct {
|
||
|
mock.Mock
|
||
|
}
|
||
|
|
||
|
type ACLServiceClient_Expecter struct {
|
||
|
mock *mock.Mock
|
||
|
}
|
||
|
|
||
|
func (_m *ACLServiceClient) EXPECT() *ACLServiceClient_Expecter {
|
||
|
return &ACLServiceClient_Expecter{mock: &_m.Mock}
|
||
|
}
|
||
|
|
||
|
// Login provides a mock function with given fields: ctx, in, opts
|
||
|
func (_m *ACLServiceClient) Login(ctx context.Context, in *pbacl.LoginRequest, opts ...grpc.CallOption) (*pbacl.LoginResponse, 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 *pbacl.LoginResponse
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbacl.LoginRequest, ...grpc.CallOption) (*pbacl.LoginResponse, error)); ok {
|
||
|
return rf(ctx, in, opts...)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbacl.LoginRequest, ...grpc.CallOption) *pbacl.LoginResponse); ok {
|
||
|
r0 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
if ret.Get(0) != nil {
|
||
|
r0 = ret.Get(0).(*pbacl.LoginResponse)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, *pbacl.LoginRequest, ...grpc.CallOption) error); ok {
|
||
|
r1 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// ACLServiceClient_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login'
|
||
|
type ACLServiceClient_Login_Call struct {
|
||
|
*mock.Call
|
||
|
}
|
||
|
|
||
|
// Login is a helper method to define mock.On call
|
||
|
// - ctx context.Context
|
||
|
// - in *pbacl.LoginRequest
|
||
|
// - opts ...grpc.CallOption
|
||
|
func (_e *ACLServiceClient_Expecter) Login(ctx interface{}, in interface{}, opts ...interface{}) *ACLServiceClient_Login_Call {
|
||
|
return &ACLServiceClient_Login_Call{Call: _e.mock.On("Login",
|
||
|
append([]interface{}{ctx, in}, opts...)...)}
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Login_Call) Run(run func(ctx context.Context, in *pbacl.LoginRequest, opts ...grpc.CallOption)) *ACLServiceClient_Login_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].(*pbacl.LoginRequest), variadicArgs...)
|
||
|
})
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Login_Call) Return(_a0 *pbacl.LoginResponse, _a1 error) *ACLServiceClient_Login_Call {
|
||
|
_c.Call.Return(_a0, _a1)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Login_Call) RunAndReturn(run func(context.Context, *pbacl.LoginRequest, ...grpc.CallOption) (*pbacl.LoginResponse, error)) *ACLServiceClient_Login_Call {
|
||
|
_c.Call.Return(run)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
// Logout provides a mock function with given fields: ctx, in, opts
|
||
|
func (_m *ACLServiceClient) Logout(ctx context.Context, in *pbacl.LogoutRequest, opts ...grpc.CallOption) (*pbacl.LogoutResponse, 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 *pbacl.LogoutResponse
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbacl.LogoutRequest, ...grpc.CallOption) (*pbacl.LogoutResponse, error)); ok {
|
||
|
return rf(ctx, in, opts...)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, *pbacl.LogoutRequest, ...grpc.CallOption) *pbacl.LogoutResponse); ok {
|
||
|
r0 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
if ret.Get(0) != nil {
|
||
|
r0 = ret.Get(0).(*pbacl.LogoutResponse)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, *pbacl.LogoutRequest, ...grpc.CallOption) error); ok {
|
||
|
r1 = rf(ctx, in, opts...)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// ACLServiceClient_Logout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logout'
|
||
|
type ACLServiceClient_Logout_Call struct {
|
||
|
*mock.Call
|
||
|
}
|
||
|
|
||
|
// Logout is a helper method to define mock.On call
|
||
|
// - ctx context.Context
|
||
|
// - in *pbacl.LogoutRequest
|
||
|
// - opts ...grpc.CallOption
|
||
|
func (_e *ACLServiceClient_Expecter) Logout(ctx interface{}, in interface{}, opts ...interface{}) *ACLServiceClient_Logout_Call {
|
||
|
return &ACLServiceClient_Logout_Call{Call: _e.mock.On("Logout",
|
||
|
append([]interface{}{ctx, in}, opts...)...)}
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Logout_Call) Run(run func(ctx context.Context, in *pbacl.LogoutRequest, opts ...grpc.CallOption)) *ACLServiceClient_Logout_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].(*pbacl.LogoutRequest), variadicArgs...)
|
||
|
})
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Logout_Call) Return(_a0 *pbacl.LogoutResponse, _a1 error) *ACLServiceClient_Logout_Call {
|
||
|
_c.Call.Return(_a0, _a1)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *ACLServiceClient_Logout_Call) RunAndReturn(run func(context.Context, *pbacl.LogoutRequest, ...grpc.CallOption) (*pbacl.LogoutResponse, error)) *ACLServiceClient_Logout_Call {
|
||
|
_c.Call.Return(run)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
// NewACLServiceClient creates a new instance of ACLServiceClient. 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 NewACLServiceClient(t interface {
|
||
|
mock.TestingT
|
||
|
Cleanup(func())
|
||
|
}) *ACLServiceClient {
|
||
|
mock := &ACLServiceClient{}
|
||
|
mock.Mock.Test(t)
|
||
|
|
||
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||
|
|
||
|
return mock
|
||
|
}
|