customer/internal/service/oauth/mocks/oauth_client.go
2023-05-16 04:12:34 +03:00

167 lines
4.8 KiB
Go

// Code generated by mockery v2.26.0. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
oauth2 "golang.org/x/oauth2"
)
// OauthClient is an autogenerated mock type for the oauthClient type
type OauthClient struct {
mock.Mock
}
type OauthClient_Expecter struct {
mock *mock.Mock
}
func (_m *OauthClient) EXPECT() *OauthClient_Expecter {
return &OauthClient_Expecter{mock: &_m.Mock}
}
// AuthCodeURL provides a mock function with given fields: state, opts
func (_m *OauthClient) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, state)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 string
if rf, ok := ret.Get(0).(func(string, ...oauth2.AuthCodeOption) string); ok {
r0 = rf(state, opts...)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// OauthClient_AuthCodeURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthCodeURL'
type OauthClient_AuthCodeURL_Call struct {
*mock.Call
}
// AuthCodeURL is a helper method to define mock.On call
// - state string
// - opts ...oauth2.AuthCodeOption
func (_e *OauthClient_Expecter) AuthCodeURL(state interface{}, opts ...interface{}) *OauthClient_AuthCodeURL_Call {
return &OauthClient_AuthCodeURL_Call{Call: _e.mock.On("AuthCodeURL",
append([]interface{}{state}, opts...)...)}
}
func (_c *OauthClient_AuthCodeURL_Call) Run(run func(state string, opts ...oauth2.AuthCodeOption)) *OauthClient_AuthCodeURL_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]oauth2.AuthCodeOption, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(oauth2.AuthCodeOption)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *OauthClient_AuthCodeURL_Call) Return(_a0 string) *OauthClient_AuthCodeURL_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OauthClient_AuthCodeURL_Call) RunAndReturn(run func(string, ...oauth2.AuthCodeOption) string) *OauthClient_AuthCodeURL_Call {
_c.Call.Return(run)
return _c
}
// Exchange provides a mock function with given fields: ctx, code, opts
func (_m *OauthClient) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, code)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *oauth2.Token
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, ...oauth2.AuthCodeOption) (*oauth2.Token, error)); ok {
return rf(ctx, code, opts...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, ...oauth2.AuthCodeOption) *oauth2.Token); ok {
r0 = rf(ctx, code, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*oauth2.Token)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, ...oauth2.AuthCodeOption) error); ok {
r1 = rf(ctx, code, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// OauthClient_Exchange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exchange'
type OauthClient_Exchange_Call struct {
*mock.Call
}
// Exchange is a helper method to define mock.On call
// - ctx context.Context
// - code string
// - opts ...oauth2.AuthCodeOption
func (_e *OauthClient_Expecter) Exchange(ctx interface{}, code interface{}, opts ...interface{}) *OauthClient_Exchange_Call {
return &OauthClient_Exchange_Call{Call: _e.mock.On("Exchange",
append([]interface{}{ctx, code}, opts...)...)}
}
func (_c *OauthClient_Exchange_Call) Run(run func(ctx context.Context, code string, opts ...oauth2.AuthCodeOption)) *OauthClient_Exchange_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]oauth2.AuthCodeOption, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(oauth2.AuthCodeOption)
}
}
run(args[0].(context.Context), args[1].(string), variadicArgs...)
})
return _c
}
func (_c *OauthClient_Exchange_Call) Return(_a0 *oauth2.Token, _a1 error) *OauthClient_Exchange_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OauthClient_Exchange_Call) RunAndReturn(run func(context.Context, string, ...oauth2.AuthCodeOption) (*oauth2.Token, error)) *OauthClient_Exchange_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewOauthClient interface {
mock.TestingT
Cleanup(func())
}
// NewOauthClient creates a new instance of OauthClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewOauthClient(t mockConstructorTestingTNewOauthClient) *OauthClient {
mock := &OauthClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}