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

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

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

	return mock
}

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

type Tokenizer_Expecter struct {
	mock *mock.Mock
}

func (_m *Tokenizer) EXPECT() *Tokenizer_Expecter {
	return &Tokenizer_Expecter{mock: &_m.Mock}
}

// Issue provides a mock function for the type Tokenizer
func (_mock *Tokenizer) Issue(key auth.Key) (string, error) {
	ret := _mock.Called(key)

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

	var r0 string
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(auth.Key) (string, error)); ok {
		return returnFunc(key)
	}
	if returnFunc, ok := ret.Get(0).(func(auth.Key) string); ok {
		r0 = returnFunc(key)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(auth.Key) error); ok {
		r1 = returnFunc(key)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Issue is a helper method to define mock.On call
//   - key auth.Key
func (_e *Tokenizer_Expecter) Issue(key interface{}) *Tokenizer_Issue_Call {
	return &Tokenizer_Issue_Call{Call: _e.mock.On("Issue", key)}
}

func (_c *Tokenizer_Issue_Call) Run(run func(key auth.Key)) *Tokenizer_Issue_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 auth.Key
		if args[0] != nil {
			arg0 = args[0].(auth.Key)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Tokenizer_Issue_Call) Return(token string, err error) *Tokenizer_Issue_Call {
	_c.Call.Return(token, err)
	return _c
}

func (_c *Tokenizer_Issue_Call) RunAndReturn(run func(key auth.Key) (string, error)) *Tokenizer_Issue_Call {
	_c.Call.Return(run)
	return _c
}

// Parse provides a mock function for the type Tokenizer
func (_mock *Tokenizer) Parse(ctx context.Context, token string) (auth.Key, error) {
	ret := _mock.Called(ctx, token)

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

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

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

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

func (_c *Tokenizer_Parse_Call) Run(run func(ctx context.Context, token string)) *Tokenizer_Parse_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 *Tokenizer_Parse_Call) Return(key auth.Key, err error) *Tokenizer_Parse_Call {
	_c.Call.Return(key, err)
	return _c
}

func (_c *Tokenizer_Parse_Call) RunAndReturn(run func(ctx context.Context, token string) (auth.Key, error)) *Tokenizer_Parse_Call {
	_c.Call.Return(run)
	return _c
}

// RetrieveJWKS provides a mock function for the type Tokenizer
func (_mock *Tokenizer) RetrieveJWKS() ([]auth.PublicKeyInfo, error) {
	ret := _mock.Called()

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

	var r0 []auth.PublicKeyInfo
	var r1 error
	if returnFunc, ok := ret.Get(0).(func() ([]auth.PublicKeyInfo, error)); ok {
		return returnFunc()
	}
	if returnFunc, ok := ret.Get(0).(func() []auth.PublicKeyInfo); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]auth.PublicKeyInfo)
		}
	}
	if returnFunc, ok := ret.Get(1).(func() error); ok {
		r1 = returnFunc()
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// RetrieveJWKS is a helper method to define mock.On call
func (_e *Tokenizer_Expecter) RetrieveJWKS() *Tokenizer_RetrieveJWKS_Call {
	return &Tokenizer_RetrieveJWKS_Call{Call: _e.mock.On("RetrieveJWKS")}
}

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

func (_c *Tokenizer_RetrieveJWKS_Call) Return(publicKeyInfos []auth.PublicKeyInfo, err error) *Tokenizer_RetrieveJWKS_Call {
	_c.Call.Return(publicKeyInfos, err)
	return _c
}

func (_c *Tokenizer_RetrieveJWKS_Call) RunAndReturn(run func() ([]auth.PublicKeyInfo, error)) *Tokenizer_RetrieveJWKS_Call {
	_c.Call.Return(run)
	return _c
}
