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

93 lines
2.8 KiB
Go

// Code generated by mockery v2.26.0. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// ServiceClient is an autogenerated mock type for the serviceClient type
type ServiceClient[T interface{}] struct {
mock.Mock
}
type ServiceClient_Expecter[T interface{}] struct {
mock *mock.Mock
}
func (_m *ServiceClient[T]) EXPECT() *ServiceClient_Expecter[T] {
return &ServiceClient_Expecter[T]{mock: &_m.Mock}
}
// GetUserInformation provides a mock function with given fields: ctx, accessToken
func (_m *ServiceClient[T]) GetUserInformation(ctx context.Context, accessToken string) (*T, error) {
ret := _m.Called(ctx, accessToken)
var r0 *T
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*T, error)); ok {
return rf(ctx, accessToken)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *T); ok {
r0 = rf(ctx, accessToken)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*T)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, accessToken)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ServiceClient_GetUserInformation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserInformation'
type ServiceClient_GetUserInformation_Call[T interface{}] struct {
*mock.Call
}
// GetUserInformation is a helper method to define mock.On call
// - ctx context.Context
// - accessToken string
func (_e *ServiceClient_Expecter[T]) GetUserInformation(ctx interface{}, accessToken interface{}) *ServiceClient_GetUserInformation_Call[T] {
return &ServiceClient_GetUserInformation_Call[T]{Call: _e.mock.On("GetUserInformation", ctx, accessToken)}
}
func (_c *ServiceClient_GetUserInformation_Call[T]) Run(run func(ctx context.Context, accessToken string)) *ServiceClient_GetUserInformation_Call[T] {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *ServiceClient_GetUserInformation_Call[T]) Return(_a0 *T, _a1 error) *ServiceClient_GetUserInformation_Call[T] {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *ServiceClient_GetUserInformation_Call[T]) RunAndReturn(run func(context.Context, string) (*T, error)) *ServiceClient_GetUserInformation_Call[T] {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewServiceClient interface {
mock.TestingT
Cleanup(func())
}
// NewServiceClient creates a new instance of ServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewServiceClient[T interface{}](t mockConstructorTestingTNewServiceClient) *ServiceClient[T] {
mock := &ServiceClient[T]{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}