consul/internal/controller/cache/indexers/indexersmock/mock_RefOrIDFetcher.go

81 lines
2.5 KiB
Go

// Code generated by mockery v2.37.1. DO NOT EDIT.
package indexersmock
import (
resource "github.com/hashicorp/consul/internal/resource"
mock "github.com/stretchr/testify/mock"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
)
// RefOrIDFetcher is an autogenerated mock type for the RefOrIDFetcher type
type RefOrIDFetcher[T protoreflect.ProtoMessage, V resource.ReferenceOrID] struct {
mock.Mock
}
type RefOrIDFetcher_Expecter[T protoreflect.ProtoMessage, V resource.ReferenceOrID] struct {
mock *mock.Mock
}
func (_m *RefOrIDFetcher[T, V]) EXPECT() *RefOrIDFetcher_Expecter[T, V] {
return &RefOrIDFetcher_Expecter[T, V]{mock: &_m.Mock}
}
// Execute provides a mock function with given fields: _a0
func (_m *RefOrIDFetcher[T, V]) Execute(_a0 *resource.DecodedResource[T]) []V {
ret := _m.Called(_a0)
var r0 []V
if rf, ok := ret.Get(0).(func(*resource.DecodedResource[T]) []V); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]V)
}
}
return r0
}
// RefOrIDFetcher_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
type RefOrIDFetcher_Execute_Call[T protoreflect.ProtoMessage, V resource.ReferenceOrID] struct {
*mock.Call
}
// Execute is a helper method to define mock.On call
// - _a0 *resource.DecodedResource[T]
func (_e *RefOrIDFetcher_Expecter[T, V]) Execute(_a0 interface{}) *RefOrIDFetcher_Execute_Call[T, V] {
return &RefOrIDFetcher_Execute_Call[T, V]{Call: _e.mock.On("Execute", _a0)}
}
func (_c *RefOrIDFetcher_Execute_Call[T, V]) Run(run func(_a0 *resource.DecodedResource[T])) *RefOrIDFetcher_Execute_Call[T, V] {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*resource.DecodedResource[T]))
})
return _c
}
func (_c *RefOrIDFetcher_Execute_Call[T, V]) Return(_a0 []V) *RefOrIDFetcher_Execute_Call[T, V] {
_c.Call.Return(_a0)
return _c
}
func (_c *RefOrIDFetcher_Execute_Call[T, V]) RunAndReturn(run func(*resource.DecodedResource[T]) []V) *RefOrIDFetcher_Execute_Call[T, V] {
_c.Call.Return(run)
return _c
}
// NewRefOrIDFetcher creates a new instance of RefOrIDFetcher. 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 NewRefOrIDFetcher[T protoreflect.ProtoMessage, V resource.ReferenceOrID](t interface {
mock.TestingT
Cleanup(func())
}) *RefOrIDFetcher[T, V] {
mock := &RefOrIDFetcher[T, V]{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}