// 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"
)

// SingleIndexer is an autogenerated mock type for the SingleIndexer type
type SingleIndexer[T protoreflect.ProtoMessage] struct {
	mock.Mock
}

type SingleIndexer_Expecter[T protoreflect.ProtoMessage] struct {
	mock *mock.Mock
}

func (_m *SingleIndexer[T]) EXPECT() *SingleIndexer_Expecter[T] {
	return &SingleIndexer_Expecter[T]{mock: &_m.Mock}
}

// Execute provides a mock function with given fields: r
func (_m *SingleIndexer[T]) Execute(r *resource.DecodedResource[T]) (bool, []byte, error) {
	ret := _m.Called(r)

	var r0 bool
	var r1 []byte
	var r2 error
	if rf, ok := ret.Get(0).(func(*resource.DecodedResource[T]) (bool, []byte, error)); ok {
		return rf(r)
	}
	if rf, ok := ret.Get(0).(func(*resource.DecodedResource[T]) bool); ok {
		r0 = rf(r)
	} else {
		r0 = ret.Get(0).(bool)
	}

	if rf, ok := ret.Get(1).(func(*resource.DecodedResource[T]) []byte); ok {
		r1 = rf(r)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).([]byte)
		}
	}

	if rf, ok := ret.Get(2).(func(*resource.DecodedResource[T]) error); ok {
		r2 = rf(r)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

// SingleIndexer_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
type SingleIndexer_Execute_Call[T protoreflect.ProtoMessage] struct {
	*mock.Call
}

// Execute is a helper method to define mock.On call
//   - r *resource.DecodedResource[T]
func (_e *SingleIndexer_Expecter[T]) Execute(r interface{}) *SingleIndexer_Execute_Call[T] {
	return &SingleIndexer_Execute_Call[T]{Call: _e.mock.On("Execute", r)}
}

func (_c *SingleIndexer_Execute_Call[T]) Run(run func(r *resource.DecodedResource[T])) *SingleIndexer_Execute_Call[T] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(*resource.DecodedResource[T]))
	})
	return _c
}

func (_c *SingleIndexer_Execute_Call[T]) Return(_a0 bool, _a1 []byte, _a2 error) *SingleIndexer_Execute_Call[T] {
	_c.Call.Return(_a0, _a1, _a2)
	return _c
}

func (_c *SingleIndexer_Execute_Call[T]) RunAndReturn(run func(*resource.DecodedResource[T]) (bool, []byte, error)) *SingleIndexer_Execute_Call[T] {
	_c.Call.Return(run)
	return _c
}

// NewSingleIndexer creates a new instance of SingleIndexer. 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 NewSingleIndexer[T protoreflect.ProtoMessage](t interface {
	mock.TestingT
	Cleanup(func())
}) *SingleIndexer[T] {
	mock := &SingleIndexer[T]{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
