github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/generators/mocks/Generator.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 "time" 9 10 "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" 11 mock "github.com/stretchr/testify/mock" 12 "sigs.k8s.io/controller-runtime/pkg/client" 13 ) 14 15 // NewGenerator creates a new instance of Generator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 16 // The first argument is typically a *testing.T value. 17 func NewGenerator(t interface { 18 mock.TestingT 19 Cleanup(func()) 20 }) *Generator { 21 mock := &Generator{} 22 mock.Mock.Test(t) 23 24 t.Cleanup(func() { mock.AssertExpectations(t) }) 25 26 return mock 27 } 28 29 // Generator is an autogenerated mock type for the Generator type 30 type Generator struct { 31 mock.Mock 32 } 33 34 type Generator_Expecter struct { 35 mock *mock.Mock 36 } 37 38 func (_m *Generator) EXPECT() *Generator_Expecter { 39 return &Generator_Expecter{mock: &_m.Mock} 40 } 41 42 // GenerateParams provides a mock function for the type Generator 43 func (_mock *Generator) GenerateParams(appSetGenerator *v1alpha1.ApplicationSetGenerator, applicationSetInfo *v1alpha1.ApplicationSet, client1 client.Client) ([]map[string]any, error) { 44 ret := _mock.Called(appSetGenerator, applicationSetInfo, client1) 45 46 if len(ret) == 0 { 47 panic("no return value specified for GenerateParams") 48 } 49 50 var r0 []map[string]any 51 var r1 error 52 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) ([]map[string]any, error)); ok { 53 return returnFunc(appSetGenerator, applicationSetInfo, client1) 54 } 55 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) []map[string]any); ok { 56 r0 = returnFunc(appSetGenerator, applicationSetInfo, client1) 57 } else { 58 if ret.Get(0) != nil { 59 r0 = ret.Get(0).([]map[string]any) 60 } 61 } 62 if returnFunc, ok := ret.Get(1).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) error); ok { 63 r1 = returnFunc(appSetGenerator, applicationSetInfo, client1) 64 } else { 65 r1 = ret.Error(1) 66 } 67 return r0, r1 68 } 69 70 // Generator_GenerateParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateParams' 71 type Generator_GenerateParams_Call struct { 72 *mock.Call 73 } 74 75 // GenerateParams is a helper method to define mock.On call 76 // - appSetGenerator *v1alpha1.ApplicationSetGenerator 77 // - applicationSetInfo *v1alpha1.ApplicationSet 78 // - client1 client.Client 79 func (_e *Generator_Expecter) GenerateParams(appSetGenerator interface{}, applicationSetInfo interface{}, client1 interface{}) *Generator_GenerateParams_Call { 80 return &Generator_GenerateParams_Call{Call: _e.mock.On("GenerateParams", appSetGenerator, applicationSetInfo, client1)} 81 } 82 83 func (_c *Generator_GenerateParams_Call) Run(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator, applicationSetInfo *v1alpha1.ApplicationSet, client1 client.Client)) *Generator_GenerateParams_Call { 84 _c.Call.Run(func(args mock.Arguments) { 85 var arg0 *v1alpha1.ApplicationSetGenerator 86 if args[0] != nil { 87 arg0 = args[0].(*v1alpha1.ApplicationSetGenerator) 88 } 89 var arg1 *v1alpha1.ApplicationSet 90 if args[1] != nil { 91 arg1 = args[1].(*v1alpha1.ApplicationSet) 92 } 93 var arg2 client.Client 94 if args[2] != nil { 95 arg2 = args[2].(client.Client) 96 } 97 run( 98 arg0, 99 arg1, 100 arg2, 101 ) 102 }) 103 return _c 104 } 105 106 func (_c *Generator_GenerateParams_Call) Return(stringToVs []map[string]any, err error) *Generator_GenerateParams_Call { 107 _c.Call.Return(stringToVs, err) 108 return _c 109 } 110 111 func (_c *Generator_GenerateParams_Call) RunAndReturn(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator, applicationSetInfo *v1alpha1.ApplicationSet, client1 client.Client) ([]map[string]any, error)) *Generator_GenerateParams_Call { 112 _c.Call.Return(run) 113 return _c 114 } 115 116 // GetRequeueAfter provides a mock function for the type Generator 117 func (_mock *Generator) GetRequeueAfter(appSetGenerator *v1alpha1.ApplicationSetGenerator) time.Duration { 118 ret := _mock.Called(appSetGenerator) 119 120 if len(ret) == 0 { 121 panic("no return value specified for GetRequeueAfter") 122 } 123 124 var r0 time.Duration 125 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator) time.Duration); ok { 126 r0 = returnFunc(appSetGenerator) 127 } else { 128 r0 = ret.Get(0).(time.Duration) 129 } 130 return r0 131 } 132 133 // Generator_GetRequeueAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRequeueAfter' 134 type Generator_GetRequeueAfter_Call struct { 135 *mock.Call 136 } 137 138 // GetRequeueAfter is a helper method to define mock.On call 139 // - appSetGenerator *v1alpha1.ApplicationSetGenerator 140 func (_e *Generator_Expecter) GetRequeueAfter(appSetGenerator interface{}) *Generator_GetRequeueAfter_Call { 141 return &Generator_GetRequeueAfter_Call{Call: _e.mock.On("GetRequeueAfter", appSetGenerator)} 142 } 143 144 func (_c *Generator_GetRequeueAfter_Call) Run(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator)) *Generator_GetRequeueAfter_Call { 145 _c.Call.Run(func(args mock.Arguments) { 146 var arg0 *v1alpha1.ApplicationSetGenerator 147 if args[0] != nil { 148 arg0 = args[0].(*v1alpha1.ApplicationSetGenerator) 149 } 150 run( 151 arg0, 152 ) 153 }) 154 return _c 155 } 156 157 func (_c *Generator_GetRequeueAfter_Call) Return(duration time.Duration) *Generator_GetRequeueAfter_Call { 158 _c.Call.Return(duration) 159 return _c 160 } 161 162 func (_c *Generator_GetRequeueAfter_Call) RunAndReturn(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator) time.Duration) *Generator_GetRequeueAfter_Call { 163 _c.Call.Return(run) 164 return _c 165 } 166 167 // GetTemplate provides a mock function for the type Generator 168 func (_mock *Generator) GetTemplate(appSetGenerator *v1alpha1.ApplicationSetGenerator) *v1alpha1.ApplicationSetTemplate { 169 ret := _mock.Called(appSetGenerator) 170 171 if len(ret) == 0 { 172 panic("no return value specified for GetTemplate") 173 } 174 175 var r0 *v1alpha1.ApplicationSetTemplate 176 if returnFunc, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator) *v1alpha1.ApplicationSetTemplate); ok { 177 r0 = returnFunc(appSetGenerator) 178 } else { 179 if ret.Get(0) != nil { 180 r0 = ret.Get(0).(*v1alpha1.ApplicationSetTemplate) 181 } 182 } 183 return r0 184 } 185 186 // Generator_GetTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTemplate' 187 type Generator_GetTemplate_Call struct { 188 *mock.Call 189 } 190 191 // GetTemplate is a helper method to define mock.On call 192 // - appSetGenerator *v1alpha1.ApplicationSetGenerator 193 func (_e *Generator_Expecter) GetTemplate(appSetGenerator interface{}) *Generator_GetTemplate_Call { 194 return &Generator_GetTemplate_Call{Call: _e.mock.On("GetTemplate", appSetGenerator)} 195 } 196 197 func (_c *Generator_GetTemplate_Call) Run(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator)) *Generator_GetTemplate_Call { 198 _c.Call.Run(func(args mock.Arguments) { 199 var arg0 *v1alpha1.ApplicationSetGenerator 200 if args[0] != nil { 201 arg0 = args[0].(*v1alpha1.ApplicationSetGenerator) 202 } 203 run( 204 arg0, 205 ) 206 }) 207 return _c 208 } 209 210 func (_c *Generator_GetTemplate_Call) Return(applicationSetTemplate *v1alpha1.ApplicationSetTemplate) *Generator_GetTemplate_Call { 211 _c.Call.Return(applicationSetTemplate) 212 return _c 213 } 214 215 func (_c *Generator_GetTemplate_Call) RunAndReturn(run func(appSetGenerator *v1alpha1.ApplicationSetGenerator) *v1alpha1.ApplicationSetTemplate) *Generator_GetTemplate_Call { 216 _c.Call.Return(run) 217 return _c 218 }