github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/eventing/automock/label_repository.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package automock 4 5 import ( 6 context "context" 7 8 mock "github.com/stretchr/testify/mock" 9 10 model "github.com/kyma-incubator/compass/components/director/internal/model" 11 ) 12 13 // LabelRepository is an autogenerated mock type for the LabelRepository type 14 type LabelRepository struct { 15 mock.Mock 16 } 17 18 // Delete provides a mock function with given fields: ctx, tenant, objectType, objectID, key 19 func (_m *LabelRepository) Delete(ctx context.Context, tenant string, objectType model.LabelableObject, objectID string, key string) error { 20 ret := _m.Called(ctx, tenant, objectType, objectID, key) 21 22 var r0 error 23 if rf, ok := ret.Get(0).(func(context.Context, string, model.LabelableObject, string, string) error); ok { 24 r0 = rf(ctx, tenant, objectType, objectID, key) 25 } else { 26 r0 = ret.Error(0) 27 } 28 29 return r0 30 } 31 32 // DeleteByKey provides a mock function with given fields: ctx, tenant, key 33 func (_m *LabelRepository) DeleteByKey(ctx context.Context, tenant string, key string) error { 34 ret := _m.Called(ctx, tenant, key) 35 36 var r0 error 37 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 38 r0 = rf(ctx, tenant, key) 39 } else { 40 r0 = ret.Error(0) 41 } 42 43 return r0 44 } 45 46 // GetByKey provides a mock function with given fields: ctx, tenant, objectType, objectID, key 47 func (_m *LabelRepository) GetByKey(ctx context.Context, tenant string, objectType model.LabelableObject, objectID string, key string) (*model.Label, error) { 48 ret := _m.Called(ctx, tenant, objectType, objectID, key) 49 50 var r0 *model.Label 51 if rf, ok := ret.Get(0).(func(context.Context, string, model.LabelableObject, string, string) *model.Label); ok { 52 r0 = rf(ctx, tenant, objectType, objectID, key) 53 } else { 54 if ret.Get(0) != nil { 55 r0 = ret.Get(0).(*model.Label) 56 } 57 } 58 59 var r1 error 60 if rf, ok := ret.Get(1).(func(context.Context, string, model.LabelableObject, string, string) error); ok { 61 r1 = rf(ctx, tenant, objectType, objectID, key) 62 } else { 63 r1 = ret.Error(1) 64 } 65 66 return r0, r1 67 } 68 69 // Upsert provides a mock function with given fields: ctx, tenant, label 70 func (_m *LabelRepository) Upsert(ctx context.Context, tenant string, label *model.Label) error { 71 ret := _m.Called(ctx, tenant, label) 72 73 var r0 error 74 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Label) error); ok { 75 r0 = rf(ctx, tenant, label) 76 } else { 77 r0 = ret.Error(0) 78 } 79 80 return r0 81 } 82 83 type mockConstructorTestingTNewLabelRepository interface { 84 mock.TestingT 85 Cleanup(func()) 86 } 87 88 // NewLabelRepository creates a new instance of LabelRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 89 func NewLabelRepository(t mockConstructorTestingTNewLabelRepository) *LabelRepository { 90 mock := &LabelRepository{} 91 mock.Mock.Test(t) 92 93 t.Cleanup(func() { mock.AssertExpectations(t) }) 94 95 return mock 96 }