github.com/jenkins-x/jx/v2@v2.1.155/pkg/vault/mocks/vault_client.go (about) 1 // Code generated by pegomock. DO NOT EDIT. 2 // Source: github.com/jenkins-x/jx/v2/pkg/vault (interfaces: Client) 3 4 package vault_test 5 6 import ( 7 url "net/url" 8 "reflect" 9 "time" 10 11 pegomock "github.com/petergtz/pegomock" 12 ) 13 14 type MockClient struct { 15 fail func(message string, callerSkip ...int) 16 } 17 18 func NewMockClient(options ...pegomock.Option) *MockClient { 19 mock := &MockClient{} 20 for _, option := range options { 21 option.Apply(mock) 22 } 23 return mock 24 } 25 26 func (mock *MockClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } 27 func (mock *MockClient) FailHandler() pegomock.FailHandler { return mock.fail } 28 29 func (mock *MockClient) Config() (url.URL, string, error) { 30 if mock == nil { 31 panic("mock must not be nil. Use myMock := NewMockClient().") 32 } 33 params := []pegomock.Param{} 34 result := pegomock.GetGenericMockFrom(mock).Invoke("Config", params, []reflect.Type{reflect.TypeOf((*url.URL)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 35 var ret0 url.URL 36 var ret1 string 37 var ret2 error 38 if len(result) != 0 { 39 if result[0] != nil { 40 ret0 = result[0].(url.URL) 41 } 42 if result[1] != nil { 43 ret1 = result[1].(string) 44 } 45 if result[2] != nil { 46 ret2 = result[2].(error) 47 } 48 } 49 return ret0, ret1, ret2 50 } 51 52 func (mock *MockClient) List(_param0 string) ([]string, error) { 53 if mock == nil { 54 panic("mock must not be nil. Use myMock := NewMockClient().") 55 } 56 params := []pegomock.Param{_param0} 57 result := pegomock.GetGenericMockFrom(mock).Invoke("List", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 58 var ret0 []string 59 var ret1 error 60 if len(result) != 0 { 61 if result[0] != nil { 62 ret0 = result[0].([]string) 63 } 64 if result[1] != nil { 65 ret1 = result[1].(error) 66 } 67 } 68 return ret0, ret1 69 } 70 71 func (mock *MockClient) Read(_param0 string) (map[string]interface{}, error) { 72 if mock == nil { 73 panic("mock must not be nil. Use myMock := NewMockClient().") 74 } 75 params := []pegomock.Param{_param0} 76 result := pegomock.GetGenericMockFrom(mock).Invoke("Read", params, []reflect.Type{reflect.TypeOf((*map[string]interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 77 var ret0 map[string]interface{} 78 var ret1 error 79 if len(result) != 0 { 80 if result[0] != nil { 81 ret0 = result[0].(map[string]interface{}) 82 } 83 if result[1] != nil { 84 ret1 = result[1].(error) 85 } 86 } 87 return ret0, ret1 88 } 89 90 func (mock *MockClient) ReadObject(_param0 string, _param1 interface{}) error { 91 if mock == nil { 92 panic("mock must not be nil. Use myMock := NewMockClient().") 93 } 94 params := []pegomock.Param{_param0, _param1} 95 result := pegomock.GetGenericMockFrom(mock).Invoke("ReadObject", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) 96 var ret0 error 97 if len(result) != 0 { 98 if result[0] != nil { 99 ret0 = result[0].(error) 100 } 101 } 102 return ret0 103 } 104 105 func (mock *MockClient) ReadYaml(_param0 string) (string, error) { 106 if mock == nil { 107 panic("mock must not be nil. Use myMock := NewMockClient().") 108 } 109 params := []pegomock.Param{_param0} 110 result := pegomock.GetGenericMockFrom(mock).Invoke("ReadYaml", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 111 var ret0 string 112 var ret1 error 113 if len(result) != 0 { 114 if result[0] != nil { 115 ret0 = result[0].(string) 116 } 117 if result[1] != nil { 118 ret1 = result[1].(error) 119 } 120 } 121 return ret0, ret1 122 } 123 124 func (mock *MockClient) ReplaceURIs(_param0 string) (string, error) { 125 if mock == nil { 126 panic("mock must not be nil. Use myMock := NewMockClient().") 127 } 128 params := []pegomock.Param{_param0} 129 result := pegomock.GetGenericMockFrom(mock).Invoke("ReplaceURIs", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 130 var ret0 string 131 var ret1 error 132 if len(result) != 0 { 133 if result[0] != nil { 134 ret0 = result[0].(string) 135 } 136 if result[1] != nil { 137 ret1 = result[1].(error) 138 } 139 } 140 return ret0, ret1 141 } 142 143 func (mock *MockClient) Write(_param0 string, _param1 map[string]interface{}) (map[string]interface{}, error) { 144 if mock == nil { 145 panic("mock must not be nil. Use myMock := NewMockClient().") 146 } 147 params := []pegomock.Param{_param0, _param1} 148 result := pegomock.GetGenericMockFrom(mock).Invoke("Write", params, []reflect.Type{reflect.TypeOf((*map[string]interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 149 var ret0 map[string]interface{} 150 var ret1 error 151 if len(result) != 0 { 152 if result[0] != nil { 153 ret0 = result[0].(map[string]interface{}) 154 } 155 if result[1] != nil { 156 ret1 = result[1].(error) 157 } 158 } 159 return ret0, ret1 160 } 161 162 func (mock *MockClient) WriteObject(_param0 string, _param1 interface{}) (map[string]interface{}, error) { 163 if mock == nil { 164 panic("mock must not be nil. Use myMock := NewMockClient().") 165 } 166 params := []pegomock.Param{_param0, _param1} 167 result := pegomock.GetGenericMockFrom(mock).Invoke("WriteObject", params, []reflect.Type{reflect.TypeOf((*map[string]interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 168 var ret0 map[string]interface{} 169 var ret1 error 170 if len(result) != 0 { 171 if result[0] != nil { 172 ret0 = result[0].(map[string]interface{}) 173 } 174 if result[1] != nil { 175 ret1 = result[1].(error) 176 } 177 } 178 return ret0, ret1 179 } 180 181 func (mock *MockClient) WriteYaml(_param0 string, _param1 string) (map[string]interface{}, error) { 182 if mock == nil { 183 panic("mock must not be nil. Use myMock := NewMockClient().") 184 } 185 params := []pegomock.Param{_param0, _param1} 186 result := pegomock.GetGenericMockFrom(mock).Invoke("WriteYaml", params, []reflect.Type{reflect.TypeOf((*map[string]interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) 187 var ret0 map[string]interface{} 188 var ret1 error 189 if len(result) != 0 { 190 if result[0] != nil { 191 ret0 = result[0].(map[string]interface{}) 192 } 193 if result[1] != nil { 194 ret1 = result[1].(error) 195 } 196 } 197 return ret0, ret1 198 } 199 200 func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { 201 return &VerifierMockClient{ 202 mock: mock, 203 invocationCountMatcher: pegomock.Times(1), 204 } 205 } 206 207 func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockClient { 208 return &VerifierMockClient{ 209 mock: mock, 210 invocationCountMatcher: invocationCountMatcher, 211 } 212 } 213 214 func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { 215 return &VerifierMockClient{ 216 mock: mock, 217 invocationCountMatcher: invocationCountMatcher, 218 inOrderContext: inOrderContext, 219 } 220 } 221 222 func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockClient { 223 return &VerifierMockClient{ 224 mock: mock, 225 invocationCountMatcher: invocationCountMatcher, 226 timeout: timeout, 227 } 228 } 229 230 type VerifierMockClient struct { 231 mock *MockClient 232 invocationCountMatcher pegomock.Matcher 233 inOrderContext *pegomock.InOrderContext 234 timeout time.Duration 235 } 236 237 func (verifier *VerifierMockClient) Config() *MockClient_Config_OngoingVerification { 238 params := []pegomock.Param{} 239 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Config", params, verifier.timeout) 240 return &MockClient_Config_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 241 } 242 243 type MockClient_Config_OngoingVerification struct { 244 mock *MockClient 245 methodInvocations []pegomock.MethodInvocation 246 } 247 248 func (c *MockClient_Config_OngoingVerification) GetCapturedArguments() { 249 } 250 251 func (c *MockClient_Config_OngoingVerification) GetAllCapturedArguments() { 252 } 253 254 func (verifier *VerifierMockClient) List(_param0 string) *MockClient_List_OngoingVerification { 255 params := []pegomock.Param{_param0} 256 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) 257 return &MockClient_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 258 } 259 260 type MockClient_List_OngoingVerification struct { 261 mock *MockClient 262 methodInvocations []pegomock.MethodInvocation 263 } 264 265 func (c *MockClient_List_OngoingVerification) GetCapturedArguments() string { 266 _param0 := c.GetAllCapturedArguments() 267 return _param0[len(_param0)-1] 268 } 269 270 func (c *MockClient_List_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { 271 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 272 if len(params) > 0 { 273 _param0 = make([]string, len(c.methodInvocations)) 274 for u, param := range params[0] { 275 _param0[u] = param.(string) 276 } 277 } 278 return 279 } 280 281 func (verifier *VerifierMockClient) Read(_param0 string) *MockClient_Read_OngoingVerification { 282 params := []pegomock.Param{_param0} 283 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Read", params, verifier.timeout) 284 return &MockClient_Read_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 285 } 286 287 type MockClient_Read_OngoingVerification struct { 288 mock *MockClient 289 methodInvocations []pegomock.MethodInvocation 290 } 291 292 func (c *MockClient_Read_OngoingVerification) GetCapturedArguments() string { 293 _param0 := c.GetAllCapturedArguments() 294 return _param0[len(_param0)-1] 295 } 296 297 func (c *MockClient_Read_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { 298 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 299 if len(params) > 0 { 300 _param0 = make([]string, len(c.methodInvocations)) 301 for u, param := range params[0] { 302 _param0[u] = param.(string) 303 } 304 } 305 return 306 } 307 308 func (verifier *VerifierMockClient) ReadObject(_param0 string, _param1 interface{}) *MockClient_ReadObject_OngoingVerification { 309 params := []pegomock.Param{_param0, _param1} 310 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ReadObject", params, verifier.timeout) 311 return &MockClient_ReadObject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 312 } 313 314 type MockClient_ReadObject_OngoingVerification struct { 315 mock *MockClient 316 methodInvocations []pegomock.MethodInvocation 317 } 318 319 func (c *MockClient_ReadObject_OngoingVerification) GetCapturedArguments() (string, interface{}) { 320 _param0, _param1 := c.GetAllCapturedArguments() 321 return _param0[len(_param0)-1], _param1[len(_param1)-1] 322 } 323 324 func (c *MockClient_ReadObject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []interface{}) { 325 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 326 if len(params) > 0 { 327 _param0 = make([]string, len(c.methodInvocations)) 328 for u, param := range params[0] { 329 _param0[u] = param.(string) 330 } 331 _param1 = make([]interface{}, len(c.methodInvocations)) 332 for u, param := range params[1] { 333 _param1[u] = param.(interface{}) 334 } 335 } 336 return 337 } 338 339 func (verifier *VerifierMockClient) ReadYaml(_param0 string) *MockClient_ReadYaml_OngoingVerification { 340 params := []pegomock.Param{_param0} 341 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ReadYaml", params, verifier.timeout) 342 return &MockClient_ReadYaml_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 343 } 344 345 type MockClient_ReadYaml_OngoingVerification struct { 346 mock *MockClient 347 methodInvocations []pegomock.MethodInvocation 348 } 349 350 func (c *MockClient_ReadYaml_OngoingVerification) GetCapturedArguments() string { 351 _param0 := c.GetAllCapturedArguments() 352 return _param0[len(_param0)-1] 353 } 354 355 func (c *MockClient_ReadYaml_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { 356 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 357 if len(params) > 0 { 358 _param0 = make([]string, len(c.methodInvocations)) 359 for u, param := range params[0] { 360 _param0[u] = param.(string) 361 } 362 } 363 return 364 } 365 366 func (verifier *VerifierMockClient) ReplaceURIs(_param0 string) *MockClient_ReplaceURIs_OngoingVerification { 367 params := []pegomock.Param{_param0} 368 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ReplaceURIs", params, verifier.timeout) 369 return &MockClient_ReplaceURIs_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 370 } 371 372 type MockClient_ReplaceURIs_OngoingVerification struct { 373 mock *MockClient 374 methodInvocations []pegomock.MethodInvocation 375 } 376 377 func (c *MockClient_ReplaceURIs_OngoingVerification) GetCapturedArguments() string { 378 _param0 := c.GetAllCapturedArguments() 379 return _param0[len(_param0)-1] 380 } 381 382 func (c *MockClient_ReplaceURIs_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { 383 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 384 if len(params) > 0 { 385 _param0 = make([]string, len(c.methodInvocations)) 386 for u, param := range params[0] { 387 _param0[u] = param.(string) 388 } 389 } 390 return 391 } 392 393 func (verifier *VerifierMockClient) Write(_param0 string, _param1 map[string]interface{}) *MockClient_Write_OngoingVerification { 394 params := []pegomock.Param{_param0, _param1} 395 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Write", params, verifier.timeout) 396 return &MockClient_Write_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 397 } 398 399 type MockClient_Write_OngoingVerification struct { 400 mock *MockClient 401 methodInvocations []pegomock.MethodInvocation 402 } 403 404 func (c *MockClient_Write_OngoingVerification) GetCapturedArguments() (string, map[string]interface{}) { 405 _param0, _param1 := c.GetAllCapturedArguments() 406 return _param0[len(_param0)-1], _param1[len(_param1)-1] 407 } 408 409 func (c *MockClient_Write_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []map[string]interface{}) { 410 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 411 if len(params) > 0 { 412 _param0 = make([]string, len(c.methodInvocations)) 413 for u, param := range params[0] { 414 _param0[u] = param.(string) 415 } 416 _param1 = make([]map[string]interface{}, len(c.methodInvocations)) 417 for u, param := range params[1] { 418 _param1[u] = param.(map[string]interface{}) 419 } 420 } 421 return 422 } 423 424 func (verifier *VerifierMockClient) WriteObject(_param0 string, _param1 interface{}) *MockClient_WriteObject_OngoingVerification { 425 params := []pegomock.Param{_param0, _param1} 426 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "WriteObject", params, verifier.timeout) 427 return &MockClient_WriteObject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 428 } 429 430 type MockClient_WriteObject_OngoingVerification struct { 431 mock *MockClient 432 methodInvocations []pegomock.MethodInvocation 433 } 434 435 func (c *MockClient_WriteObject_OngoingVerification) GetCapturedArguments() (string, interface{}) { 436 _param0, _param1 := c.GetAllCapturedArguments() 437 return _param0[len(_param0)-1], _param1[len(_param1)-1] 438 } 439 440 func (c *MockClient_WriteObject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []interface{}) { 441 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 442 if len(params) > 0 { 443 _param0 = make([]string, len(c.methodInvocations)) 444 for u, param := range params[0] { 445 _param0[u] = param.(string) 446 } 447 _param1 = make([]interface{}, len(c.methodInvocations)) 448 for u, param := range params[1] { 449 _param1[u] = param.(interface{}) 450 } 451 } 452 return 453 } 454 455 func (verifier *VerifierMockClient) WriteYaml(_param0 string, _param1 string) *MockClient_WriteYaml_OngoingVerification { 456 params := []pegomock.Param{_param0, _param1} 457 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "WriteYaml", params, verifier.timeout) 458 return &MockClient_WriteYaml_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 459 } 460 461 type MockClient_WriteYaml_OngoingVerification struct { 462 mock *MockClient 463 methodInvocations []pegomock.MethodInvocation 464 } 465 466 func (c *MockClient_WriteYaml_OngoingVerification) GetCapturedArguments() (string, string) { 467 _param0, _param1 := c.GetAllCapturedArguments() 468 return _param0[len(_param0)-1], _param1[len(_param1)-1] 469 } 470 471 func (c *MockClient_WriteYaml_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string) { 472 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 473 if len(params) > 0 { 474 _param0 = make([]string, len(c.methodInvocations)) 475 for u, param := range params[0] { 476 _param0[u] = param.(string) 477 } 478 _param1 = make([]string, len(c.methodInvocations)) 479 for u, param := range params[1] { 480 _param1[u] = param.(string) 481 } 482 } 483 return 484 }