// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

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

package mocks

import (
	"context"

	"github.com/absmach/magistrala/pkg/events"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Subscriber_Expecter struct {
	mock *mock.Mock
}

func (_m *Subscriber) EXPECT() *Subscriber_Expecter {
	return &Subscriber_Expecter{mock: &_m.Mock}
}

// Close provides a mock function for the type Subscriber
func (_mock *Subscriber) Close() error {
	ret := _mock.Called()

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func() error); ok {
		r0 = returnFunc()
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Close is a helper method to define mock.On call
func (_e *Subscriber_Expecter) Close() *Subscriber_Close_Call {
	return &Subscriber_Close_Call{Call: _e.mock.On("Close")}
}

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

func (_c *Subscriber_Close_Call) Return(err error) *Subscriber_Close_Call {
	_c.Call.Return(err)
	return _c
}

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

// Subscribe provides a mock function for the type Subscriber
func (_mock *Subscriber) Subscribe(ctx context.Context, cfg events.SubscriberConfig) error {
	ret := _mock.Called(ctx, cfg)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, events.SubscriberConfig) error); ok {
		r0 = returnFunc(ctx, cfg)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Subscribe is a helper method to define mock.On call
//   - ctx context.Context
//   - cfg events.SubscriberConfig
func (_e *Subscriber_Expecter) Subscribe(ctx interface{}, cfg interface{}) *Subscriber_Subscribe_Call {
	return &Subscriber_Subscribe_Call{Call: _e.mock.On("Subscribe", ctx, cfg)}
}

func (_c *Subscriber_Subscribe_Call) Run(run func(ctx context.Context, cfg events.SubscriberConfig)) *Subscriber_Subscribe_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 events.SubscriberConfig
		if args[1] != nil {
			arg1 = args[1].(events.SubscriberConfig)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Subscriber_Subscribe_Call) Return(err error) *Subscriber_Subscribe_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Subscriber_Subscribe_Call) RunAndReturn(run func(ctx context.Context, cfg events.SubscriberConfig) error) *Subscriber_Subscribe_Call {
	_c.Call.Return(run)
	return _c
}
