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

120 lines
3.1 KiB
Go
Raw Normal View History

// Code generated by mockery v2.37.1. DO NOT EDIT.
package cachemock
import (
pbresource "github.com/hashicorp/consul/proto-public/pbresource"
mock "github.com/stretchr/testify/mock"
)
// WriteCache is an autogenerated mock type for the WriteCache type
type WriteCache struct {
mock.Mock
}
type WriteCache_Expecter struct {
mock *mock.Mock
}
func (_m *WriteCache) EXPECT() *WriteCache_Expecter {
return &WriteCache_Expecter{mock: &_m.Mock}
}
// Delete provides a mock function with given fields: r
func (_m *WriteCache) Delete(r *pbresource.Resource) error {
ret := _m.Called(r)
var r0 error
if rf, ok := ret.Get(0).(func(*pbresource.Resource) error); ok {
r0 = rf(r)
} else {
r0 = ret.Error(0)
}
return r0
}
// WriteCache_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type WriteCache_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - r *pbresource.Resource
func (_e *WriteCache_Expecter) Delete(r interface{}) *WriteCache_Delete_Call {
return &WriteCache_Delete_Call{Call: _e.mock.On("Delete", r)}
}
func (_c *WriteCache_Delete_Call) Run(run func(r *pbresource.Resource)) *WriteCache_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*pbresource.Resource))
})
return _c
}
func (_c *WriteCache_Delete_Call) Return(_a0 error) *WriteCache_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *WriteCache_Delete_Call) RunAndReturn(run func(*pbresource.Resource) error) *WriteCache_Delete_Call {
_c.Call.Return(run)
return _c
}
// Insert provides a mock function with given fields: r
func (_m *WriteCache) Insert(r *pbresource.Resource) error {
ret := _m.Called(r)
var r0 error
if rf, ok := ret.Get(0).(func(*pbresource.Resource) error); ok {
r0 = rf(r)
} else {
r0 = ret.Error(0)
}
return r0
}
// WriteCache_Insert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Insert'
type WriteCache_Insert_Call struct {
*mock.Call
}
// Insert is a helper method to define mock.On call
// - r *pbresource.Resource
func (_e *WriteCache_Expecter) Insert(r interface{}) *WriteCache_Insert_Call {
return &WriteCache_Insert_Call{Call: _e.mock.On("Insert", r)}
}
func (_c *WriteCache_Insert_Call) Run(run func(r *pbresource.Resource)) *WriteCache_Insert_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*pbresource.Resource))
})
return _c
}
func (_c *WriteCache_Insert_Call) Return(_a0 error) *WriteCache_Insert_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *WriteCache_Insert_Call) RunAndReturn(run func(*pbresource.Resource) error) *WriteCache_Insert_Call {
_c.Call.Return(run)
return _c
}
// NewWriteCache creates a new instance of WriteCache. 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 NewWriteCache(t interface {
mock.TestingT
Cleanup(func())
}) *WriteCache {
mock := &WriteCache{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}