github.com/argoproj/argo-cd/v3@v3.2.1/commitserver/commit/mocks/RepoClientFactory.go (about) 1 // Code generated by mockery; DO NOT EDIT. 2 // github.com/vektra/mockery 3 // template: testify 4 5 package mocks 6 7 import ( 8 "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" 9 "github.com/argoproj/argo-cd/v3/util/git" 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // NewRepoClientFactory creates a new instance of RepoClientFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 14 // The first argument is typically a *testing.T value. 15 func NewRepoClientFactory(t interface { 16 mock.TestingT 17 Cleanup(func()) 18 }) *RepoClientFactory { 19 mock := &RepoClientFactory{} 20 mock.Mock.Test(t) 21 22 t.Cleanup(func() { mock.AssertExpectations(t) }) 23 24 return mock 25 } 26 27 // RepoClientFactory is an autogenerated mock type for the RepoClientFactory type 28 type RepoClientFactory struct { 29 mock.Mock 30 } 31 32 type RepoClientFactory_Expecter struct { 33 mock *mock.Mock 34 } 35 36 func (_m *RepoClientFactory) EXPECT() *RepoClientFactory_Expecter { 37 return &RepoClientFactory_Expecter{mock: &_m.Mock} 38 } 39 40 // NewClient provides a mock function for the type RepoClientFactory 41 func (_mock *RepoClientFactory) NewClient(repo *v1alpha1.Repository, rootPath string) (git.Client, error) { 42 ret := _mock.Called(repo, rootPath) 43 44 if len(ret) == 0 { 45 panic("no return value specified for NewClient") 46 } 47 48 var r0 git.Client 49 var r1 error 50 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Repository, string) (git.Client, error)); ok { 51 return returnFunc(repo, rootPath) 52 } 53 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Repository, string) git.Client); ok { 54 r0 = returnFunc(repo, rootPath) 55 } else { 56 if ret.Get(0) != nil { 57 r0 = ret.Get(0).(git.Client) 58 } 59 } 60 if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Repository, string) error); ok { 61 r1 = returnFunc(repo, rootPath) 62 } else { 63 r1 = ret.Error(1) 64 } 65 return r0, r1 66 } 67 68 // RepoClientFactory_NewClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewClient' 69 type RepoClientFactory_NewClient_Call struct { 70 *mock.Call 71 } 72 73 // NewClient is a helper method to define mock.On call 74 // - repo *v1alpha1.Repository 75 // - rootPath string 76 func (_e *RepoClientFactory_Expecter) NewClient(repo interface{}, rootPath interface{}) *RepoClientFactory_NewClient_Call { 77 return &RepoClientFactory_NewClient_Call{Call: _e.mock.On("NewClient", repo, rootPath)} 78 } 79 80 func (_c *RepoClientFactory_NewClient_Call) Run(run func(repo *v1alpha1.Repository, rootPath string)) *RepoClientFactory_NewClient_Call { 81 _c.Call.Run(func(args mock.Arguments) { 82 var arg0 *v1alpha1.Repository 83 if args[0] != nil { 84 arg0 = args[0].(*v1alpha1.Repository) 85 } 86 var arg1 string 87 if args[1] != nil { 88 arg1 = args[1].(string) 89 } 90 run( 91 arg0, 92 arg1, 93 ) 94 }) 95 return _c 96 } 97 98 func (_c *RepoClientFactory_NewClient_Call) Return(client git.Client, err error) *RepoClientFactory_NewClient_Call { 99 _c.Call.Return(client, err) 100 return _c 101 } 102 103 func (_c *RepoClientFactory_NewClient_Call) RunAndReturn(run func(repo *v1alpha1.Repository, rootPath string) (git.Client, error)) *RepoClientFactory_NewClient_Call { 104 _c.Call.Return(run) 105 return _c 106 }