mirror of https://github.com/status-im/consul.git
97 lines
2.9 KiB
Go
97 lines
2.9 KiB
Go
|
// Code generated by mockery v2.37.1. DO NOT EDIT.
|
||
|
|
||
|
package dependencymock
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
|
||
|
controller "github.com/hashicorp/consul/internal/controller"
|
||
|
|
||
|
mock "github.com/stretchr/testify/mock"
|
||
|
|
||
|
pbresource "github.com/hashicorp/consul/proto-public/pbresource"
|
||
|
)
|
||
|
|
||
|
// CacheIDModifier is an autogenerated mock type for the CacheIDModifier type
|
||
|
type CacheIDModifier struct {
|
||
|
mock.Mock
|
||
|
}
|
||
|
|
||
|
type CacheIDModifier_Expecter struct {
|
||
|
mock *mock.Mock
|
||
|
}
|
||
|
|
||
|
func (_m *CacheIDModifier) EXPECT() *CacheIDModifier_Expecter {
|
||
|
return &CacheIDModifier_Expecter{mock: &_m.Mock}
|
||
|
}
|
||
|
|
||
|
// Execute provides a mock function with given fields: ctx, rt, id
|
||
|
func (_m *CacheIDModifier) Execute(ctx context.Context, rt controller.Runtime, id *pbresource.ID) (*pbresource.ID, error) {
|
||
|
ret := _m.Called(ctx, rt, id)
|
||
|
|
||
|
var r0 *pbresource.ID
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, controller.Runtime, *pbresource.ID) (*pbresource.ID, error)); ok {
|
||
|
return rf(ctx, rt, id)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, controller.Runtime, *pbresource.ID) *pbresource.ID); ok {
|
||
|
r0 = rf(ctx, rt, id)
|
||
|
} else {
|
||
|
if ret.Get(0) != nil {
|
||
|
r0 = ret.Get(0).(*pbresource.ID)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, controller.Runtime, *pbresource.ID) error); ok {
|
||
|
r1 = rf(ctx, rt, id)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// CacheIDModifier_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
|
||
|
type CacheIDModifier_Execute_Call struct {
|
||
|
*mock.Call
|
||
|
}
|
||
|
|
||
|
// Execute is a helper method to define mock.On call
|
||
|
// - ctx context.Context
|
||
|
// - rt controller.Runtime
|
||
|
// - id *pbresource.ID
|
||
|
func (_e *CacheIDModifier_Expecter) Execute(ctx interface{}, rt interface{}, id interface{}) *CacheIDModifier_Execute_Call {
|
||
|
return &CacheIDModifier_Execute_Call{Call: _e.mock.On("Execute", ctx, rt, id)}
|
||
|
}
|
||
|
|
||
|
func (_c *CacheIDModifier_Execute_Call) Run(run func(ctx context.Context, rt controller.Runtime, id *pbresource.ID)) *CacheIDModifier_Execute_Call {
|
||
|
_c.Call.Run(func(args mock.Arguments) {
|
||
|
run(args[0].(context.Context), args[1].(controller.Runtime), args[2].(*pbresource.ID))
|
||
|
})
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *CacheIDModifier_Execute_Call) Return(_a0 *pbresource.ID, _a1 error) *CacheIDModifier_Execute_Call {
|
||
|
_c.Call.Return(_a0, _a1)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
func (_c *CacheIDModifier_Execute_Call) RunAndReturn(run func(context.Context, controller.Runtime, *pbresource.ID) (*pbresource.ID, error)) *CacheIDModifier_Execute_Call {
|
||
|
_c.Call.Return(run)
|
||
|
return _c
|
||
|
}
|
||
|
|
||
|
// NewCacheIDModifier creates a new instance of CacheIDModifier. 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 NewCacheIDModifier(t interface {
|
||
|
mock.TestingT
|
||
|
Cleanup(func())
|
||
|
}) *CacheIDModifier {
|
||
|
mock := &CacheIDModifier{}
|
||
|
mock.Mock.Test(t)
|
||
|
|
||
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||
|
|
||
|
return mock
|
||
|
}
|