github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/application/automock/application_repository.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package automock 4 5 import ( 6 context "context" 7 8 labelfilter "github.com/kyma-incubator/compass/components/director/internal/labelfilter" 9 mock "github.com/stretchr/testify/mock" 10 11 model "github.com/kyma-incubator/compass/components/director/internal/model" 12 13 uuid "github.com/google/uuid" 14 ) 15 16 // ApplicationRepository is an autogenerated mock type for the ApplicationRepository type 17 type ApplicationRepository struct { 18 mock.Mock 19 } 20 21 // Create provides a mock function with given fields: ctx, tenant, item 22 func (_m *ApplicationRepository) Create(ctx context.Context, tenant string, item *model.Application) error { 23 ret := _m.Called(ctx, tenant, item) 24 25 var r0 error 26 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Application) error); ok { 27 r0 = rf(ctx, tenant, item) 28 } else { 29 r0 = ret.Error(0) 30 } 31 32 return r0 33 } 34 35 // Delete provides a mock function with given fields: ctx, tenant, id 36 func (_m *ApplicationRepository) Delete(ctx context.Context, tenant string, id string) error { 37 ret := _m.Called(ctx, tenant, id) 38 39 var r0 error 40 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 41 r0 = rf(ctx, tenant, id) 42 } else { 43 r0 = ret.Error(0) 44 } 45 46 return r0 47 } 48 49 // DeleteGlobal provides a mock function with given fields: ctx, id 50 func (_m *ApplicationRepository) DeleteGlobal(ctx context.Context, id string) error { 51 ret := _m.Called(ctx, id) 52 53 var r0 error 54 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 55 r0 = rf(ctx, id) 56 } else { 57 r0 = ret.Error(0) 58 } 59 60 return r0 61 } 62 63 // Exists provides a mock function with given fields: ctx, tenant, id 64 func (_m *ApplicationRepository) Exists(ctx context.Context, tenant string, id string) (bool, error) { 65 ret := _m.Called(ctx, tenant, id) 66 67 var r0 bool 68 if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { 69 r0 = rf(ctx, tenant, id) 70 } else { 71 r0 = ret.Get(0).(bool) 72 } 73 74 var r1 error 75 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 76 r1 = rf(ctx, tenant, id) 77 } else { 78 r1 = ret.Error(1) 79 } 80 81 return r0, r1 82 } 83 84 // GetByFilter provides a mock function with given fields: ctx, tenant, filter 85 func (_m *ApplicationRepository) GetByFilter(ctx context.Context, tenant string, filter []*labelfilter.LabelFilter) (*model.Application, error) { 86 ret := _m.Called(ctx, tenant, filter) 87 88 var r0 *model.Application 89 if rf, ok := ret.Get(0).(func(context.Context, string, []*labelfilter.LabelFilter) *model.Application); ok { 90 r0 = rf(ctx, tenant, filter) 91 } else { 92 if ret.Get(0) != nil { 93 r0 = ret.Get(0).(*model.Application) 94 } 95 } 96 97 var r1 error 98 if rf, ok := ret.Get(1).(func(context.Context, string, []*labelfilter.LabelFilter) error); ok { 99 r1 = rf(ctx, tenant, filter) 100 } else { 101 r1 = ret.Error(1) 102 } 103 104 return r0, r1 105 } 106 107 // GetByID provides a mock function with given fields: ctx, tenant, id 108 func (_m *ApplicationRepository) GetByID(ctx context.Context, tenant string, id string) (*model.Application, error) { 109 ret := _m.Called(ctx, tenant, id) 110 111 var r0 *model.Application 112 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Application); ok { 113 r0 = rf(ctx, tenant, id) 114 } else { 115 if ret.Get(0) != nil { 116 r0 = ret.Get(0).(*model.Application) 117 } 118 } 119 120 var r1 error 121 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 122 r1 = rf(ctx, tenant, id) 123 } else { 124 r1 = ret.Error(1) 125 } 126 127 return r0, r1 128 } 129 130 // GetByIDForUpdate provides a mock function with given fields: ctx, tenant, id 131 func (_m *ApplicationRepository) GetByIDForUpdate(ctx context.Context, tenant string, id string) (*model.Application, error) { 132 ret := _m.Called(ctx, tenant, id) 133 134 var r0 *model.Application 135 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Application); ok { 136 r0 = rf(ctx, tenant, id) 137 } else { 138 if ret.Get(0) != nil { 139 r0 = ret.Get(0).(*model.Application) 140 } 141 } 142 143 var r1 error 144 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 145 r1 = rf(ctx, tenant, id) 146 } else { 147 r1 = ret.Error(1) 148 } 149 150 return r0, r1 151 } 152 153 // GetBySystemNumber provides a mock function with given fields: ctx, tenant, systemNumber 154 func (_m *ApplicationRepository) GetBySystemNumber(ctx context.Context, tenant string, systemNumber string) (*model.Application, error) { 155 ret := _m.Called(ctx, tenant, systemNumber) 156 157 var r0 *model.Application 158 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Application); ok { 159 r0 = rf(ctx, tenant, systemNumber) 160 } else { 161 if ret.Get(0) != nil { 162 r0 = ret.Get(0).(*model.Application) 163 } 164 } 165 166 var r1 error 167 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 168 r1 = rf(ctx, tenant, systemNumber) 169 } else { 170 r1 = ret.Error(1) 171 } 172 173 return r0, r1 174 } 175 176 // GetGlobalByID provides a mock function with given fields: ctx, id 177 func (_m *ApplicationRepository) GetGlobalByID(ctx context.Context, id string) (*model.Application, error) { 178 ret := _m.Called(ctx, id) 179 180 var r0 *model.Application 181 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Application); ok { 182 r0 = rf(ctx, id) 183 } else { 184 if ret.Get(0) != nil { 185 r0 = ret.Get(0).(*model.Application) 186 } 187 } 188 189 var r1 error 190 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 191 r1 = rf(ctx, id) 192 } else { 193 r1 = ret.Error(1) 194 } 195 196 return r0, r1 197 } 198 199 // List provides a mock function with given fields: ctx, tenant, filter, pageSize, cursor 200 func (_m *ApplicationRepository) List(ctx context.Context, tenant string, filter []*labelfilter.LabelFilter, pageSize int, cursor string) (*model.ApplicationPage, error) { 201 ret := _m.Called(ctx, tenant, filter, pageSize, cursor) 202 203 var r0 *model.ApplicationPage 204 if rf, ok := ret.Get(0).(func(context.Context, string, []*labelfilter.LabelFilter, int, string) *model.ApplicationPage); ok { 205 r0 = rf(ctx, tenant, filter, pageSize, cursor) 206 } else { 207 if ret.Get(0) != nil { 208 r0 = ret.Get(0).(*model.ApplicationPage) 209 } 210 } 211 212 var r1 error 213 if rf, ok := ret.Get(1).(func(context.Context, string, []*labelfilter.LabelFilter, int, string) error); ok { 214 r1 = rf(ctx, tenant, filter, pageSize, cursor) 215 } else { 216 r1 = ret.Error(1) 217 } 218 219 return r0, r1 220 } 221 222 // ListAll provides a mock function with given fields: ctx, tenant 223 func (_m *ApplicationRepository) ListAll(ctx context.Context, tenant string) ([]*model.Application, error) { 224 ret := _m.Called(ctx, tenant) 225 226 var r0 []*model.Application 227 if rf, ok := ret.Get(0).(func(context.Context, string) []*model.Application); ok { 228 r0 = rf(ctx, tenant) 229 } else { 230 if ret.Get(0) != nil { 231 r0 = ret.Get(0).([]*model.Application) 232 } 233 } 234 235 var r1 error 236 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 237 r1 = rf(ctx, tenant) 238 } else { 239 r1 = ret.Error(1) 240 } 241 242 return r0, r1 243 } 244 245 // ListAllByApplicationTemplateID provides a mock function with given fields: ctx, applicationTemplateID 246 func (_m *ApplicationRepository) ListAllByApplicationTemplateID(ctx context.Context, applicationTemplateID string) ([]*model.Application, error) { 247 ret := _m.Called(ctx, applicationTemplateID) 248 249 var r0 []*model.Application 250 if rf, ok := ret.Get(0).(func(context.Context, string) []*model.Application); ok { 251 r0 = rf(ctx, applicationTemplateID) 252 } else { 253 if ret.Get(0) != nil { 254 r0 = ret.Get(0).([]*model.Application) 255 } 256 } 257 258 var r1 error 259 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 260 r1 = rf(ctx, applicationTemplateID) 261 } else { 262 r1 = ret.Error(1) 263 } 264 265 return r0, r1 266 } 267 268 // ListAllByFilter provides a mock function with given fields: ctx, tenant, filter 269 func (_m *ApplicationRepository) ListAllByFilter(ctx context.Context, tenant string, filter []*labelfilter.LabelFilter) ([]*model.Application, error) { 270 ret := _m.Called(ctx, tenant, filter) 271 272 var r0 []*model.Application 273 if rf, ok := ret.Get(0).(func(context.Context, string, []*labelfilter.LabelFilter) []*model.Application); ok { 274 r0 = rf(ctx, tenant, filter) 275 } else { 276 if ret.Get(0) != nil { 277 r0 = ret.Get(0).([]*model.Application) 278 } 279 } 280 281 var r1 error 282 if rf, ok := ret.Get(1).(func(context.Context, string, []*labelfilter.LabelFilter) error); ok { 283 r1 = rf(ctx, tenant, filter) 284 } else { 285 r1 = ret.Error(1) 286 } 287 288 return r0, r1 289 } 290 291 // ListAllByIDs provides a mock function with given fields: ctx, tenantID, ids 292 func (_m *ApplicationRepository) ListAllByIDs(ctx context.Context, tenantID string, ids []string) ([]*model.Application, error) { 293 ret := _m.Called(ctx, tenantID, ids) 294 295 var r0 []*model.Application 296 if rf, ok := ret.Get(0).(func(context.Context, string, []string) []*model.Application); ok { 297 r0 = rf(ctx, tenantID, ids) 298 } else { 299 if ret.Get(0) != nil { 300 r0 = ret.Get(0).([]*model.Application) 301 } 302 } 303 304 var r1 error 305 if rf, ok := ret.Get(1).(func(context.Context, string, []string) error); ok { 306 r1 = rf(ctx, tenantID, ids) 307 } else { 308 r1 = ret.Error(1) 309 } 310 311 return r0, r1 312 } 313 314 // ListByScenarios provides a mock function with given fields: ctx, tenantID, scenarios, pageSize, cursor, hidingSelectors 315 func (_m *ApplicationRepository) ListByScenarios(ctx context.Context, tenantID uuid.UUID, scenarios []string, pageSize int, cursor string, hidingSelectors map[string][]string) (*model.ApplicationPage, error) { 316 ret := _m.Called(ctx, tenantID, scenarios, pageSize, cursor, hidingSelectors) 317 318 var r0 *model.ApplicationPage 319 if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, []string, int, string, map[string][]string) *model.ApplicationPage); ok { 320 r0 = rf(ctx, tenantID, scenarios, pageSize, cursor, hidingSelectors) 321 } else { 322 if ret.Get(0) != nil { 323 r0 = ret.Get(0).(*model.ApplicationPage) 324 } 325 } 326 327 var r1 error 328 if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID, []string, int, string, map[string][]string) error); ok { 329 r1 = rf(ctx, tenantID, scenarios, pageSize, cursor, hidingSelectors) 330 } else { 331 r1 = ret.Error(1) 332 } 333 334 return r0, r1 335 } 336 337 // ListByScenariosAndIDs provides a mock function with given fields: ctx, tenant, scenarios, ids 338 func (_m *ApplicationRepository) ListByScenariosAndIDs(ctx context.Context, tenant string, scenarios []string, ids []string) ([]*model.Application, error) { 339 ret := _m.Called(ctx, tenant, scenarios, ids) 340 341 var r0 []*model.Application 342 if rf, ok := ret.Get(0).(func(context.Context, string, []string, []string) []*model.Application); ok { 343 r0 = rf(ctx, tenant, scenarios, ids) 344 } else { 345 if ret.Get(0) != nil { 346 r0 = ret.Get(0).([]*model.Application) 347 } 348 } 349 350 var r1 error 351 if rf, ok := ret.Get(1).(func(context.Context, string, []string, []string) error); ok { 352 r1 = rf(ctx, tenant, scenarios, ids) 353 } else { 354 r1 = ret.Error(1) 355 } 356 357 return r0, r1 358 } 359 360 // ListByScenariosNoPaging provides a mock function with given fields: ctx, tenant, scenarios 361 func (_m *ApplicationRepository) ListByScenariosNoPaging(ctx context.Context, tenant string, scenarios []string) ([]*model.Application, error) { 362 ret := _m.Called(ctx, tenant, scenarios) 363 364 var r0 []*model.Application 365 if rf, ok := ret.Get(0).(func(context.Context, string, []string) []*model.Application); ok { 366 r0 = rf(ctx, tenant, scenarios) 367 } else { 368 if ret.Get(0) != nil { 369 r0 = ret.Get(0).([]*model.Application) 370 } 371 } 372 373 var r1 error 374 if rf, ok := ret.Get(1).(func(context.Context, string, []string) error); ok { 375 r1 = rf(ctx, tenant, scenarios) 376 } else { 377 r1 = ret.Error(1) 378 } 379 380 return r0, r1 381 } 382 383 // ListGlobal provides a mock function with given fields: ctx, pageSize, cursor 384 func (_m *ApplicationRepository) ListGlobal(ctx context.Context, pageSize int, cursor string) (*model.ApplicationPage, error) { 385 ret := _m.Called(ctx, pageSize, cursor) 386 387 var r0 *model.ApplicationPage 388 if rf, ok := ret.Get(0).(func(context.Context, int, string) *model.ApplicationPage); ok { 389 r0 = rf(ctx, pageSize, cursor) 390 } else { 391 if ret.Get(0) != nil { 392 r0 = ret.Get(0).(*model.ApplicationPage) 393 } 394 } 395 396 var r1 error 397 if rf, ok := ret.Get(1).(func(context.Context, int, string) error); ok { 398 r1 = rf(ctx, pageSize, cursor) 399 } else { 400 r1 = ret.Error(1) 401 } 402 403 return r0, r1 404 } 405 406 // ListListeningApplications provides a mock function with given fields: ctx, tenant, whType 407 func (_m *ApplicationRepository) ListListeningApplications(ctx context.Context, tenant string, whType model.WebhookType) ([]*model.Application, error) { 408 ret := _m.Called(ctx, tenant, whType) 409 410 var r0 []*model.Application 411 if rf, ok := ret.Get(0).(func(context.Context, string, model.WebhookType) []*model.Application); ok { 412 r0 = rf(ctx, tenant, whType) 413 } else { 414 if ret.Get(0) != nil { 415 r0 = ret.Get(0).([]*model.Application) 416 } 417 } 418 419 var r1 error 420 if rf, ok := ret.Get(1).(func(context.Context, string, model.WebhookType) error); ok { 421 r1 = rf(ctx, tenant, whType) 422 } else { 423 r1 = ret.Error(1) 424 } 425 426 return r0, r1 427 } 428 429 // OwnerExists provides a mock function with given fields: ctx, tenant, id 430 func (_m *ApplicationRepository) OwnerExists(ctx context.Context, tenant string, id string) (bool, error) { 431 ret := _m.Called(ctx, tenant, id) 432 433 var r0 bool 434 if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { 435 r0 = rf(ctx, tenant, id) 436 } else { 437 r0 = ret.Get(0).(bool) 438 } 439 440 var r1 error 441 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 442 r1 = rf(ctx, tenant, id) 443 } else { 444 r1 = ret.Error(1) 445 } 446 447 return r0, r1 448 } 449 450 // TechnicalUpdate provides a mock function with given fields: ctx, item 451 func (_m *ApplicationRepository) TechnicalUpdate(ctx context.Context, item *model.Application) error { 452 ret := _m.Called(ctx, item) 453 454 var r0 error 455 if rf, ok := ret.Get(0).(func(context.Context, *model.Application) error); ok { 456 r0 = rf(ctx, item) 457 } else { 458 r0 = ret.Error(0) 459 } 460 461 return r0 462 } 463 464 // TrustedUpsert provides a mock function with given fields: ctx, tenant, _a2 465 func (_m *ApplicationRepository) TrustedUpsert(ctx context.Context, tenant string, _a2 *model.Application) (string, error) { 466 ret := _m.Called(ctx, tenant, _a2) 467 468 var r0 string 469 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Application) string); ok { 470 r0 = rf(ctx, tenant, _a2) 471 } else { 472 r0 = ret.Get(0).(string) 473 } 474 475 var r1 error 476 if rf, ok := ret.Get(1).(func(context.Context, string, *model.Application) error); ok { 477 r1 = rf(ctx, tenant, _a2) 478 } else { 479 r1 = ret.Error(1) 480 } 481 482 return r0, r1 483 } 484 485 // Update provides a mock function with given fields: ctx, tenant, item 486 func (_m *ApplicationRepository) Update(ctx context.Context, tenant string, item *model.Application) error { 487 ret := _m.Called(ctx, tenant, item) 488 489 var r0 error 490 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Application) error); ok { 491 r0 = rf(ctx, tenant, item) 492 } else { 493 r0 = ret.Error(0) 494 } 495 496 return r0 497 } 498 499 // Upsert provides a mock function with given fields: ctx, tenant, _a2 500 func (_m *ApplicationRepository) Upsert(ctx context.Context, tenant string, _a2 *model.Application) (string, error) { 501 ret := _m.Called(ctx, tenant, _a2) 502 503 var r0 string 504 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Application) string); ok { 505 r0 = rf(ctx, tenant, _a2) 506 } else { 507 r0 = ret.Get(0).(string) 508 } 509 510 var r1 error 511 if rf, ok := ret.Get(1).(func(context.Context, string, *model.Application) error); ok { 512 r1 = rf(ctx, tenant, _a2) 513 } else { 514 r1 = ret.Error(1) 515 } 516 517 return r0, r1 518 } 519 520 type mockConstructorTestingTNewApplicationRepository interface { 521 mock.TestingT 522 Cleanup(func()) 523 } 524 525 // NewApplicationRepository creates a new instance of ApplicationRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 526 func NewApplicationRepository(t mockConstructorTestingTNewApplicationRepository) *ApplicationRepository { 527 mock := &ApplicationRepository{} 528 mock.Mock.Test(t) 529 530 t.Cleanup(func() { mock.AssertExpectations(t) }) 531 532 return mock 533 }