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

package node_mocks

import (
	common "github.com/anycable/anycable-go/common"
	mock "github.com/stretchr/testify/mock"

	node "github.com/anycable/anycable-go/node"
)

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

// Authenticate provides a mock function with given fields: s, opts
func (_m *AppNode) Authenticate(s *node.Session, opts ...func(*node.AuthOptions)) (*common.ConnectResult, error) {
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, s)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 *common.ConnectResult
	var r1 error
	if rf, ok := ret.Get(0).(func(*node.Session, ...func(*node.AuthOptions)) (*common.ConnectResult, error)); ok {
		return rf(s, opts...)
	}
	if rf, ok := ret.Get(0).(func(*node.Session, ...func(*node.AuthOptions)) *common.ConnectResult); ok {
		r0 = rf(s, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.ConnectResult)
		}
	}

	if rf, ok := ret.Get(1).(func(*node.Session, ...func(*node.AuthOptions)) error); ok {
		r1 = rf(s, opts...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Authenticated provides a mock function with given fields: s, identifiers
func (_m *AppNode) Authenticated(s *node.Session, identifiers string) {
	_m.Called(s, identifiers)
}

// Disconnect provides a mock function with given fields: s
func (_m *AppNode) Disconnect(s *node.Session) error {
	ret := _m.Called(s)

	var r0 error
	if rf, ok := ret.Get(0).(func(*node.Session) error); ok {
		r0 = rf(s)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// HandlePubSub provides a mock function with given fields: msg
func (_m *AppNode) HandlePubSub(msg []byte) {
	_m.Called(msg)
}

// LookupSession provides a mock function with given fields: id
func (_m *AppNode) LookupSession(id string) *node.Session {
	ret := _m.Called(id)

	var r0 *node.Session
	if rf, ok := ret.Get(0).(func(string) *node.Session); ok {
		r0 = rf(id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*node.Session)
		}
	}

	return r0
}

// Perform provides a mock function with given fields: s, msg
func (_m *AppNode) Perform(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
	ret := _m.Called(s, msg)

	var r0 *common.CommandResult
	var r1 error
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
		return rf(s, msg)
	}
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
		r0 = rf(s, msg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.CommandResult)
		}
	}

	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
		r1 = rf(s, msg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Subscribe provides a mock function with given fields: s, msg
func (_m *AppNode) Subscribe(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
	ret := _m.Called(s, msg)

	var r0 *common.CommandResult
	var r1 error
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
		return rf(s, msg)
	}
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
		r0 = rf(s, msg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.CommandResult)
		}
	}

	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
		r1 = rf(s, msg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Unsubscribe provides a mock function with given fields: s, msg
func (_m *AppNode) Unsubscribe(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
	ret := _m.Called(s, msg)

	var r0 *common.CommandResult
	var r1 error
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
		return rf(s, msg)
	}
	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
		r0 = rf(s, msg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.CommandResult)
		}
	}

	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
		r1 = rf(s, msg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

type mockConstructorTestingTNewAppNode interface {
	mock.TestingT
	Cleanup(func())
}

// NewAppNode creates a new instance of AppNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAppNode(t mockConstructorTestingTNewAppNode) *AppNode {
	mock := &AppNode{}
	mock.Mock.Test(t)

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

	return mock
}
