// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package cachemock

import (
	"github.com/hashicorp/consul/internal/resource"
	mock "github.com/stretchr/testify/mock"
	"google.golang.org/protobuf/proto"
)

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

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

	return mock
}

// DecodedResourceIterator is an autogenerated mock type for the DecodedResourceIterator type
type DecodedResourceIterator[T proto.Message] struct {
	mock.Mock
}

type DecodedResourceIterator_Expecter[T proto.Message] struct {
	mock *mock.Mock
}

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

// Next provides a mock function for the type DecodedResourceIterator
func (_mock *DecodedResourceIterator[T]) Next() (*resource.DecodedResource[T], error) {
	ret := _mock.Called()

	if len(ret) == 0 {
		panic("no return value specified for Next")
	}

	var r0 *resource.DecodedResource[T]
	var r1 error
	if returnFunc, ok := ret.Get(0).(func() (*resource.DecodedResource[T], error)); ok {
		return returnFunc()
	}
	if returnFunc, ok := ret.Get(0).(func() *resource.DecodedResource[T]); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*resource.DecodedResource[T])
		}
	}
	if returnFunc, ok := ret.Get(1).(func() error); ok {
		r1 = returnFunc()
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// DecodedResourceIterator_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next'
type DecodedResourceIterator_Next_Call[T proto.Message] struct {
	*mock.Call
}

// Next is a helper method to define mock.On call
func (_e *DecodedResourceIterator_Expecter[T]) Next() *DecodedResourceIterator_Next_Call[T] {
	return &DecodedResourceIterator_Next_Call[T]{Call: _e.mock.On("Next")}
}

func (_c *DecodedResourceIterator_Next_Call[T]) Run(run func()) *DecodedResourceIterator_Next_Call[T] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *DecodedResourceIterator_Next_Call[T]) Return(decodedResource *resource.DecodedResource[T], err error) *DecodedResourceIterator_Next_Call[T] {
	_c.Call.Return(decodedResource, err)
	return _c
}

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