// Code generated by mockery v2.40.1. DO NOT EDIT.

package mocks

import (
	cluster "github.com/hyperledger/fabric/orderer/common/cluster"
	mock "github.com/stretchr/testify/mock"
)

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

type Communicator_Expecter struct {
	mock *mock.Mock
}

func (_m *Communicator) EXPECT() *Communicator_Expecter {
	return &Communicator_Expecter{mock: &_m.Mock}
}

// Configure provides a mock function with given fields: channel, members
func (_m *Communicator) Configure(channel string, members []cluster.RemoteNode) {
	_m.Called(channel, members)
}

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

// Configure is a helper method to define mock.On call
//   - channel string
//   - members []cluster.RemoteNode
func (_e *Communicator_Expecter) Configure(channel interface{}, members interface{}) *Communicator_Configure_Call {
	return &Communicator_Configure_Call{Call: _e.mock.On("Configure", channel, members)}
}

func (_c *Communicator_Configure_Call) Run(run func(channel string, members []cluster.RemoteNode)) *Communicator_Configure_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string), args[1].([]cluster.RemoteNode))
	})
	return _c
}

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

func (_c *Communicator_Configure_Call) RunAndReturn(run func(string, []cluster.RemoteNode)) *Communicator_Configure_Call {
	_c.Call.Return(run)
	return _c
}

// Remote provides a mock function with given fields: channel, id
func (_m *Communicator) Remote(channel string, id uint64) (*cluster.RemoteContext, error) {
	ret := _m.Called(channel, id)

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

	var r0 *cluster.RemoteContext
	var r1 error
	if rf, ok := ret.Get(0).(func(string, uint64) (*cluster.RemoteContext, error)); ok {
		return rf(channel, id)
	}
	if rf, ok := ret.Get(0).(func(string, uint64) *cluster.RemoteContext); ok {
		r0 = rf(channel, id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*cluster.RemoteContext)
		}
	}

	if rf, ok := ret.Get(1).(func(string, uint64) error); ok {
		r1 = rf(channel, id)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

// Remote is a helper method to define mock.On call
//   - channel string
//   - id uint64
func (_e *Communicator_Expecter) Remote(channel interface{}, id interface{}) *Communicator_Remote_Call {
	return &Communicator_Remote_Call{Call: _e.mock.On("Remote", channel, id)}
}

func (_c *Communicator_Remote_Call) Run(run func(channel string, id uint64)) *Communicator_Remote_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string), args[1].(uint64))
	})
	return _c
}

func (_c *Communicator_Remote_Call) Return(_a0 *cluster.RemoteContext, _a1 error) *Communicator_Remote_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Communicator_Remote_Call) RunAndReturn(run func(string, uint64) (*cluster.RemoteContext, error)) *Communicator_Remote_Call {
	_c.Call.Return(run)
	return _c
}

// Shutdown provides a mock function with given fields:
func (_m *Communicator) Shutdown() {
	_m.Called()
}

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

// Shutdown is a helper method to define mock.On call
func (_e *Communicator_Expecter) Shutdown() *Communicator_Shutdown_Call {
	return &Communicator_Shutdown_Call{Call: _e.mock.On("Shutdown")}
}

func (_c *Communicator_Shutdown_Call) Run(run func()) *Communicator_Shutdown_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

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

func (_c *Communicator_Shutdown_Call) RunAndReturn(run func()) *Communicator_Shutdown_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
