// 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/authn"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Authentication_Expecter struct {
	mock *mock.Mock
}

func (_m *Authentication) EXPECT() *Authentication_Expecter {
	return &Authentication_Expecter{mock: &_m.Mock}
}

// Authenticate provides a mock function for the type Authentication
func (_mock *Authentication) Authenticate(ctx context.Context, token string) (authn.Session, error) {
	ret := _mock.Called(ctx, token)

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

	var r0 authn.Session
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (authn.Session, error)); ok {
		return returnFunc(ctx, token)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) authn.Session); ok {
		r0 = returnFunc(ctx, token)
	} else {
		r0 = ret.Get(0).(authn.Session)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, token)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Authenticate is a helper method to define mock.On call
//   - ctx context.Context
//   - token string
func (_e *Authentication_Expecter) Authenticate(ctx interface{}, token interface{}) *Authentication_Authenticate_Call {
	return &Authentication_Authenticate_Call{Call: _e.mock.On("Authenticate", ctx, token)}
}

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

func (_c *Authentication_Authenticate_Call) Return(session authn.Session, err error) *Authentication_Authenticate_Call {
	_c.Call.Return(session, err)
	return _c
}

func (_c *Authentication_Authenticate_Call) RunAndReturn(run func(ctx context.Context, token string) (authn.Session, error)) *Authentication_Authenticate_Call {
	_c.Call.Return(run)
	return _c
}
