consul/internal/controller/cache/cachemock/mock_Query.go

101 lines
2.7 KiB
Go
Raw Normal View History

// Code generated by mockery v2.37.1. DO NOT EDIT.
package cachemock
import (
cache "github.com/hashicorp/consul/internal/controller/cache"
mock "github.com/stretchr/testify/mock"
)
// Query is an autogenerated mock type for the Query type
type Query struct {
mock.Mock
}
type Query_Expecter struct {
mock *mock.Mock
}
func (_m *Query) EXPECT() *Query_Expecter {
return &Query_Expecter{mock: &_m.Mock}
}
// Execute provides a mock function with given fields: c, args
func (_m *Query) Execute(c cache.ReadOnlyCache, args ...interface{}) (cache.ResourceIterator, error) {
var _ca []interface{}
_ca = append(_ca, c)
_ca = append(_ca, args...)
ret := _m.Called(_ca...)
var r0 cache.ResourceIterator
var r1 error
if rf, ok := ret.Get(0).(func(cache.ReadOnlyCache, ...interface{}) (cache.ResourceIterator, error)); ok {
return rf(c, args...)
}
if rf, ok := ret.Get(0).(func(cache.ReadOnlyCache, ...interface{}) cache.ResourceIterator); ok {
r0 = rf(c, args...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(cache.ResourceIterator)
}
}
if rf, ok := ret.Get(1).(func(cache.ReadOnlyCache, ...interface{}) error); ok {
r1 = rf(c, args...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Query_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
type Query_Execute_Call struct {
*mock.Call
}
// Execute is a helper method to define mock.On call
// - c cache.ReadOnlyCache
// - args ...interface{}
func (_e *Query_Expecter) Execute(c interface{}, args ...interface{}) *Query_Execute_Call {
return &Query_Execute_Call{Call: _e.mock.On("Execute",
append([]interface{}{c}, args...)...)}
}
func (_c *Query_Execute_Call) Run(run func(c cache.ReadOnlyCache, args ...interface{})) *Query_Execute_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(cache.ReadOnlyCache), variadicArgs...)
})
return _c
}
func (_c *Query_Execute_Call) Return(_a0 cache.ResourceIterator, _a1 error) *Query_Execute_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Query_Execute_Call) RunAndReturn(run func(cache.ReadOnlyCache, ...interface{}) (cache.ResourceIterator, error)) *Query_Execute_Call {
_c.Call.Return(run)
return _c
}
// NewQuery creates a new instance of Query. 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 NewQuery(t interface {
mock.TestingT
Cleanup(func())
}) *Query {
mock := &Query{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}