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

package mocks

import (
	"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
	mock "github.com/stretchr/testify/mock"
)

// NewBroadcaster creates a new instance of Broadcaster. 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 NewBroadcaster(t interface {
	mock.TestingT
	Cleanup(func())
}) *Broadcaster {
	mock := &Broadcaster{}
	mock.Mock.Test(t)

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

	return mock
}

// Broadcaster is an autogenerated mock type for the Broadcaster type
type Broadcaster struct {
	mock.Mock
}

type Broadcaster_Expecter struct {
	mock *mock.Mock
}

func (_m *Broadcaster) EXPECT() *Broadcaster_Expecter {
	return &Broadcaster_Expecter{mock: &_m.Mock}
}

// OnAdd provides a mock function for the type Broadcaster
func (_mock *Broadcaster) OnAdd(v any, b bool) {
	_mock.Called(v, b)
	return
}

// Broadcaster_OnAdd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnAdd'
type Broadcaster_OnAdd_Call struct {
	*mock.Call
}

// OnAdd is a helper method to define mock.On call
//   - v any
//   - b bool
func (_e *Broadcaster_Expecter) OnAdd(v interface{}, b interface{}) *Broadcaster_OnAdd_Call {
	return &Broadcaster_OnAdd_Call{Call: _e.mock.On("OnAdd", v, b)}
}

func (_c *Broadcaster_OnAdd_Call) Run(run func(v any, b bool)) *Broadcaster_OnAdd_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		var arg1 bool
		if args[1] != nil {
			arg1 = args[1].(bool)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Broadcaster_OnAdd_Call) Return() *Broadcaster_OnAdd_Call {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnAdd_Call) RunAndReturn(run func(v any, b bool)) *Broadcaster_OnAdd_Call {
	_c.Run(run)
	return _c
}

// OnDelete provides a mock function for the type Broadcaster
func (_mock *Broadcaster) OnDelete(v any) {
	_mock.Called(v)
	return
}

// Broadcaster_OnDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDelete'
type Broadcaster_OnDelete_Call struct {
	*mock.Call
}

// OnDelete is a helper method to define mock.On call
//   - v any
func (_e *Broadcaster_Expecter) OnDelete(v interface{}) *Broadcaster_OnDelete_Call {
	return &Broadcaster_OnDelete_Call{Call: _e.mock.On("OnDelete", v)}
}

func (_c *Broadcaster_OnDelete_Call) Run(run func(v any)) *Broadcaster_OnDelete_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Broadcaster_OnDelete_Call) Return() *Broadcaster_OnDelete_Call {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnDelete_Call) RunAndReturn(run func(v any)) *Broadcaster_OnDelete_Call {
	_c.Run(run)
	return _c
}

// OnUpdate provides a mock function for the type Broadcaster
func (_mock *Broadcaster) OnUpdate(v any, v1 any) {
	_mock.Called(v, v1)
	return
}

// Broadcaster_OnUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnUpdate'
type Broadcaster_OnUpdate_Call struct {
	*mock.Call
}

// OnUpdate is a helper method to define mock.On call
//   - v any
//   - v1 any
func (_e *Broadcaster_Expecter) OnUpdate(v interface{}, v1 interface{}) *Broadcaster_OnUpdate_Call {
	return &Broadcaster_OnUpdate_Call{Call: _e.mock.On("OnUpdate", v, v1)}
}

func (_c *Broadcaster_OnUpdate_Call) Run(run func(v any, v1 any)) *Broadcaster_OnUpdate_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		var arg1 any
		if args[1] != nil {
			arg1 = args[1].(any)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Broadcaster_OnUpdate_Call) Return() *Broadcaster_OnUpdate_Call {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnUpdate_Call) RunAndReturn(run func(v any, v1 any)) *Broadcaster_OnUpdate_Call {
	_c.Run(run)
	return _c
}

// Subscribe provides a mock function for the type Broadcaster
func (_mock *Broadcaster) Subscribe(ch chan *v1alpha1.ApplicationWatchEvent, filters ...func(event *v1alpha1.ApplicationWatchEvent) bool) func() {
	// func(event *v1alpha1.ApplicationWatchEvent) bool
	_va := make([]interface{}, len(filters))
	for _i := range filters {
		_va[_i] = filters[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ch)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 func()
	if returnFunc, ok := ret.Get(0).(func(chan *v1alpha1.ApplicationWatchEvent, ...func(event *v1alpha1.ApplicationWatchEvent) bool) func()); ok {
		r0 = returnFunc(ch, filters...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(func())
		}
	}
	return r0
}

// Broadcaster_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe'
type Broadcaster_Subscribe_Call struct {
	*mock.Call
}

// Subscribe is a helper method to define mock.On call
//   - ch chan *v1alpha1.ApplicationWatchEvent
//   - filters ...func(event *v1alpha1.ApplicationWatchEvent) bool
func (_e *Broadcaster_Expecter) Subscribe(ch interface{}, filters ...interface{}) *Broadcaster_Subscribe_Call {
	return &Broadcaster_Subscribe_Call{Call: _e.mock.On("Subscribe",
		append([]interface{}{ch}, filters...)...)}
}

func (_c *Broadcaster_Subscribe_Call) Run(run func(ch chan *v1alpha1.ApplicationWatchEvent, filters ...func(event *v1alpha1.ApplicationWatchEvent) bool)) *Broadcaster_Subscribe_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 chan *v1alpha1.ApplicationWatchEvent
		if args[0] != nil {
			arg0 = args[0].(chan *v1alpha1.ApplicationWatchEvent)
		}
		var arg1 []func(event *v1alpha1.ApplicationWatchEvent) bool
		variadicArgs := make([]func(event *v1alpha1.ApplicationWatchEvent) bool, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(func(event *v1alpha1.ApplicationWatchEvent) bool)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

func (_c *Broadcaster_Subscribe_Call) Return(fn func()) *Broadcaster_Subscribe_Call {
	_c.Call.Return(fn)
	return _c
}

func (_c *Broadcaster_Subscribe_Call) RunAndReturn(run func(ch chan *v1alpha1.ApplicationWatchEvent, filters ...func(event *v1alpha1.ApplicationWatchEvent) bool) func()) *Broadcaster_Subscribe_Call {
	_c.Call.Return(run)
	return _c
}
