flamingo.me/flamingo-commerce/v3@v3.11.0/customer/domain/mocks/customer_identity_service.go (about) 1 // Code generated by mockery v2.42.3. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 auth "flamingo.me/flamingo/v3/core/auth" 9 10 domain "flamingo.me/flamingo-commerce/v3/customer/domain" 11 12 mock "github.com/stretchr/testify/mock" 13 ) 14 15 // CustomerIdentityService is an autogenerated mock type for the CustomerIdentityService type 16 type CustomerIdentityService struct { 17 mock.Mock 18 } 19 20 type CustomerIdentityService_Expecter struct { 21 mock *mock.Mock 22 } 23 24 func (_m *CustomerIdentityService) EXPECT() *CustomerIdentityService_Expecter { 25 return &CustomerIdentityService_Expecter{mock: &_m.Mock} 26 } 27 28 // GetByIdentity provides a mock function with given fields: ctx, identity 29 func (_m *CustomerIdentityService) GetByIdentity(ctx context.Context, identity auth.Identity) (domain.Customer, error) { 30 ret := _m.Called(ctx, identity) 31 32 if len(ret) == 0 { 33 panic("no return value specified for GetByIdentity") 34 } 35 36 var r0 domain.Customer 37 var r1 error 38 if rf, ok := ret.Get(0).(func(context.Context, auth.Identity) (domain.Customer, error)); ok { 39 return rf(ctx, identity) 40 } 41 if rf, ok := ret.Get(0).(func(context.Context, auth.Identity) domain.Customer); ok { 42 r0 = rf(ctx, identity) 43 } else { 44 if ret.Get(0) != nil { 45 r0 = ret.Get(0).(domain.Customer) 46 } 47 } 48 49 if rf, ok := ret.Get(1).(func(context.Context, auth.Identity) error); ok { 50 r1 = rf(ctx, identity) 51 } else { 52 r1 = ret.Error(1) 53 } 54 55 return r0, r1 56 } 57 58 // CustomerIdentityService_GetByIdentity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByIdentity' 59 type CustomerIdentityService_GetByIdentity_Call struct { 60 *mock.Call 61 } 62 63 // GetByIdentity is a helper method to define mock.On call 64 // - ctx context.Context 65 // - identity auth.Identity 66 func (_e *CustomerIdentityService_Expecter) GetByIdentity(ctx interface{}, identity interface{}) *CustomerIdentityService_GetByIdentity_Call { 67 return &CustomerIdentityService_GetByIdentity_Call{Call: _e.mock.On("GetByIdentity", ctx, identity)} 68 } 69 70 func (_c *CustomerIdentityService_GetByIdentity_Call) Run(run func(ctx context.Context, identity auth.Identity)) *CustomerIdentityService_GetByIdentity_Call { 71 _c.Call.Run(func(args mock.Arguments) { 72 run(args[0].(context.Context), args[1].(auth.Identity)) 73 }) 74 return _c 75 } 76 77 func (_c *CustomerIdentityService_GetByIdentity_Call) Return(_a0 domain.Customer, _a1 error) *CustomerIdentityService_GetByIdentity_Call { 78 _c.Call.Return(_a0, _a1) 79 return _c 80 } 81 82 func (_c *CustomerIdentityService_GetByIdentity_Call) RunAndReturn(run func(context.Context, auth.Identity) (domain.Customer, error)) *CustomerIdentityService_GetByIdentity_Call { 83 _c.Call.Return(run) 84 return _c 85 } 86 87 // NewCustomerIdentityService creates a new instance of CustomerIdentityService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 88 // The first argument is typically a *testing.T value. 89 func NewCustomerIdentityService(t interface { 90 mock.TestingT 91 Cleanup(func()) 92 }) *CustomerIdentityService { 93 mock := &CustomerIdentityService{} 94 mock.Mock.Test(t) 95 96 t.Cleanup(func() { mock.AssertExpectations(t) }) 97 98 return mock 99 }