github.com/argoproj/argo-cd/v3@v3.2.1/controller/hydrator/mocks/RepoGetter.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 "context" 9 10 "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" 11 mock "github.com/stretchr/testify/mock" 12 ) 13 14 // NewRepoGetter creates a new instance of RepoGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 15 // The first argument is typically a *testing.T value. 16 func NewRepoGetter(t interface { 17 mock.TestingT 18 Cleanup(func()) 19 }) *RepoGetter { 20 mock := &RepoGetter{} 21 mock.Mock.Test(t) 22 23 t.Cleanup(func() { mock.AssertExpectations(t) }) 24 25 return mock 26 } 27 28 // RepoGetter is an autogenerated mock type for the RepoGetter type 29 type RepoGetter struct { 30 mock.Mock 31 } 32 33 type RepoGetter_Expecter struct { 34 mock *mock.Mock 35 } 36 37 func (_m *RepoGetter) EXPECT() *RepoGetter_Expecter { 38 return &RepoGetter_Expecter{mock: &_m.Mock} 39 } 40 41 // GetRepository provides a mock function for the type RepoGetter 42 func (_mock *RepoGetter) GetRepository(ctx context.Context, repoURL string, project string) (*v1alpha1.Repository, error) { 43 ret := _mock.Called(ctx, repoURL, project) 44 45 if len(ret) == 0 { 46 panic("no return value specified for GetRepository") 47 } 48 49 var r0 *v1alpha1.Repository 50 var r1 error 51 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.Repository, error)); ok { 52 return returnFunc(ctx, repoURL, project) 53 } 54 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.Repository); ok { 55 r0 = returnFunc(ctx, repoURL, project) 56 } else { 57 if ret.Get(0) != nil { 58 r0 = ret.Get(0).(*v1alpha1.Repository) 59 } 60 } 61 if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 62 r1 = returnFunc(ctx, repoURL, project) 63 } else { 64 r1 = ret.Error(1) 65 } 66 return r0, r1 67 } 68 69 // RepoGetter_GetRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepository' 70 type RepoGetter_GetRepository_Call struct { 71 *mock.Call 72 } 73 74 // GetRepository is a helper method to define mock.On call 75 // - ctx context.Context 76 // - repoURL string 77 // - project string 78 func (_e *RepoGetter_Expecter) GetRepository(ctx interface{}, repoURL interface{}, project interface{}) *RepoGetter_GetRepository_Call { 79 return &RepoGetter_GetRepository_Call{Call: _e.mock.On("GetRepository", ctx, repoURL, project)} 80 } 81 82 func (_c *RepoGetter_GetRepository_Call) Run(run func(ctx context.Context, repoURL string, project string)) *RepoGetter_GetRepository_Call { 83 _c.Call.Run(func(args mock.Arguments) { 84 var arg0 context.Context 85 if args[0] != nil { 86 arg0 = args[0].(context.Context) 87 } 88 var arg1 string 89 if args[1] != nil { 90 arg1 = args[1].(string) 91 } 92 var arg2 string 93 if args[2] != nil { 94 arg2 = args[2].(string) 95 } 96 run( 97 arg0, 98 arg1, 99 arg2, 100 ) 101 }) 102 return _c 103 } 104 105 func (_c *RepoGetter_GetRepository_Call) Return(repository *v1alpha1.Repository, err error) *RepoGetter_GetRepository_Call { 106 _c.Call.Return(repository, err) 107 return _c 108 } 109 110 func (_c *RepoGetter_GetRepository_Call) RunAndReturn(run func(ctx context.Context, repoURL string, project string) (*v1alpha1.Repository, error)) *RepoGetter_GetRepository_Call { 111 _c.Call.Return(run) 112 return _c 113 }