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

package granthandlersmock

import (
	model0 "github.com/asgardeo/thunder/internal/application/model"
	"github.com/asgardeo/thunder/internal/oauth/oauth2/model"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type GrantHandlerInterfaceMock_Expecter struct {
	mock *mock.Mock
}

func (_m *GrantHandlerInterfaceMock) EXPECT() *GrantHandlerInterfaceMock_Expecter {
	return &GrantHandlerInterfaceMock_Expecter{mock: &_m.Mock}
}

// HandleGrant provides a mock function for the type GrantHandlerInterfaceMock
func (_mock *GrantHandlerInterfaceMock) HandleGrant(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO, ctx *model.TokenContext) (*model.TokenResponseDTO, *model.ErrorResponse) {
	ret := _mock.Called(tokenRequest, oauthApp, ctx)

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

	var r0 *model.TokenResponseDTO
	var r1 *model.ErrorResponse
	if returnFunc, ok := ret.Get(0).(func(*model.TokenRequest, *model0.OAuthAppConfigProcessedDTO, *model.TokenContext) (*model.TokenResponseDTO, *model.ErrorResponse)); ok {
		return returnFunc(tokenRequest, oauthApp, ctx)
	}
	if returnFunc, ok := ret.Get(0).(func(*model.TokenRequest, *model0.OAuthAppConfigProcessedDTO, *model.TokenContext) *model.TokenResponseDTO); ok {
		r0 = returnFunc(tokenRequest, oauthApp, ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*model.TokenResponseDTO)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(*model.TokenRequest, *model0.OAuthAppConfigProcessedDTO, *model.TokenContext) *model.ErrorResponse); ok {
		r1 = returnFunc(tokenRequest, oauthApp, ctx)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).(*model.ErrorResponse)
		}
	}
	return r0, r1
}

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

// HandleGrant is a helper method to define mock.On call
//   - tokenRequest *model.TokenRequest
//   - oauthApp *model0.OAuthAppConfigProcessedDTO
//   - ctx *model.TokenContext
func (_e *GrantHandlerInterfaceMock_Expecter) HandleGrant(tokenRequest interface{}, oauthApp interface{}, ctx interface{}) *GrantHandlerInterfaceMock_HandleGrant_Call {
	return &GrantHandlerInterfaceMock_HandleGrant_Call{Call: _e.mock.On("HandleGrant", tokenRequest, oauthApp, ctx)}
}

func (_c *GrantHandlerInterfaceMock_HandleGrant_Call) Run(run func(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO, ctx *model.TokenContext)) *GrantHandlerInterfaceMock_HandleGrant_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *model.TokenRequest
		if args[0] != nil {
			arg0 = args[0].(*model.TokenRequest)
		}
		var arg1 *model0.OAuthAppConfigProcessedDTO
		if args[1] != nil {
			arg1 = args[1].(*model0.OAuthAppConfigProcessedDTO)
		}
		var arg2 *model.TokenContext
		if args[2] != nil {
			arg2 = args[2].(*model.TokenContext)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *GrantHandlerInterfaceMock_HandleGrant_Call) Return(tokenResponseDTO *model.TokenResponseDTO, errorResponse *model.ErrorResponse) *GrantHandlerInterfaceMock_HandleGrant_Call {
	_c.Call.Return(tokenResponseDTO, errorResponse)
	return _c
}

func (_c *GrantHandlerInterfaceMock_HandleGrant_Call) RunAndReturn(run func(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO, ctx *model.TokenContext) (*model.TokenResponseDTO, *model.ErrorResponse)) *GrantHandlerInterfaceMock_HandleGrant_Call {
	_c.Call.Return(run)
	return _c
}

// ValidateGrant provides a mock function for the type GrantHandlerInterfaceMock
func (_mock *GrantHandlerInterfaceMock) ValidateGrant(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO) *model.ErrorResponse {
	ret := _mock.Called(tokenRequest, oauthApp)

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

	var r0 *model.ErrorResponse
	if returnFunc, ok := ret.Get(0).(func(*model.TokenRequest, *model0.OAuthAppConfigProcessedDTO) *model.ErrorResponse); ok {
		r0 = returnFunc(tokenRequest, oauthApp)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*model.ErrorResponse)
		}
	}
	return r0
}

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

// ValidateGrant is a helper method to define mock.On call
//   - tokenRequest *model.TokenRequest
//   - oauthApp *model0.OAuthAppConfigProcessedDTO
func (_e *GrantHandlerInterfaceMock_Expecter) ValidateGrant(tokenRequest interface{}, oauthApp interface{}) *GrantHandlerInterfaceMock_ValidateGrant_Call {
	return &GrantHandlerInterfaceMock_ValidateGrant_Call{Call: _e.mock.On("ValidateGrant", tokenRequest, oauthApp)}
}

func (_c *GrantHandlerInterfaceMock_ValidateGrant_Call) Run(run func(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO)) *GrantHandlerInterfaceMock_ValidateGrant_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *model.TokenRequest
		if args[0] != nil {
			arg0 = args[0].(*model.TokenRequest)
		}
		var arg1 *model0.OAuthAppConfigProcessedDTO
		if args[1] != nil {
			arg1 = args[1].(*model0.OAuthAppConfigProcessedDTO)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *GrantHandlerInterfaceMock_ValidateGrant_Call) Return(errorResponse *model.ErrorResponse) *GrantHandlerInterfaceMock_ValidateGrant_Call {
	_c.Call.Return(errorResponse)
	return _c
}

func (_c *GrantHandlerInterfaceMock_ValidateGrant_Call) RunAndReturn(run func(tokenRequest *model.TokenRequest, oauthApp *model0.OAuthAppConfigProcessedDTO) *model.ErrorResponse) *GrantHandlerInterfaceMock_ValidateGrant_Call {
	_c.Call.Return(run)
	return _c
}
