github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/webhook/automock/webhook_repository.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package automock 4 5 import ( 6 context "context" 7 8 model "github.com/kyma-incubator/compass/components/director/internal/model" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // WebhookRepository is an autogenerated mock type for the WebhookRepository type 13 type WebhookRepository struct { 14 mock.Mock 15 } 16 17 // Create provides a mock function with given fields: ctx, tenant, item 18 func (_m *WebhookRepository) Create(ctx context.Context, tenant string, item *model.Webhook) error { 19 ret := _m.Called(ctx, tenant, item) 20 21 var r0 error 22 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Webhook) error); ok { 23 r0 = rf(ctx, tenant, item) 24 } else { 25 r0 = ret.Error(0) 26 } 27 28 return r0 29 } 30 31 // Delete provides a mock function with given fields: ctx, id 32 func (_m *WebhookRepository) Delete(ctx context.Context, id string) error { 33 ret := _m.Called(ctx, id) 34 35 var r0 error 36 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 37 r0 = rf(ctx, id) 38 } else { 39 r0 = ret.Error(0) 40 } 41 42 return r0 43 } 44 45 // GetByID provides a mock function with given fields: ctx, tenant, id, objectType 46 func (_m *WebhookRepository) GetByID(ctx context.Context, tenant string, id string, objectType model.WebhookReferenceObjectType) (*model.Webhook, error) { 47 ret := _m.Called(ctx, tenant, id, objectType) 48 49 var r0 *model.Webhook 50 if rf, ok := ret.Get(0).(func(context.Context, string, string, model.WebhookReferenceObjectType) *model.Webhook); ok { 51 r0 = rf(ctx, tenant, id, objectType) 52 } else { 53 if ret.Get(0) != nil { 54 r0 = ret.Get(0).(*model.Webhook) 55 } 56 } 57 58 var r1 error 59 if rf, ok := ret.Get(1).(func(context.Context, string, string, model.WebhookReferenceObjectType) error); ok { 60 r1 = rf(ctx, tenant, id, objectType) 61 } else { 62 r1 = ret.Error(1) 63 } 64 65 return r0, r1 66 } 67 68 // GetByIDGlobal provides a mock function with given fields: ctx, id 69 func (_m *WebhookRepository) GetByIDGlobal(ctx context.Context, id string) (*model.Webhook, error) { 70 ret := _m.Called(ctx, id) 71 72 var r0 *model.Webhook 73 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Webhook); ok { 74 r0 = rf(ctx, id) 75 } else { 76 if ret.Get(0) != nil { 77 r0 = ret.Get(0).(*model.Webhook) 78 } 79 } 80 81 var r1 error 82 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 83 r1 = rf(ctx, id) 84 } else { 85 r1 = ret.Error(1) 86 } 87 88 return r0, r1 89 } 90 91 // ListByApplicationTemplateID provides a mock function with given fields: ctx, applicationTemplateID 92 func (_m *WebhookRepository) ListByApplicationTemplateID(ctx context.Context, applicationTemplateID string) ([]*model.Webhook, error) { 93 ret := _m.Called(ctx, applicationTemplateID) 94 95 var r0 []*model.Webhook 96 if rf, ok := ret.Get(0).(func(context.Context, string) []*model.Webhook); ok { 97 r0 = rf(ctx, applicationTemplateID) 98 } else { 99 if ret.Get(0) != nil { 100 r0 = ret.Get(0).([]*model.Webhook) 101 } 102 } 103 104 var r1 error 105 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 106 r1 = rf(ctx, applicationTemplateID) 107 } else { 108 r1 = ret.Error(1) 109 } 110 111 return r0, r1 112 } 113 114 // ListByReferenceObjectID provides a mock function with given fields: ctx, tenant, objID, objType 115 func (_m *WebhookRepository) ListByReferenceObjectID(ctx context.Context, tenant string, objID string, objType model.WebhookReferenceObjectType) ([]*model.Webhook, error) { 116 ret := _m.Called(ctx, tenant, objID, objType) 117 118 var r0 []*model.Webhook 119 if rf, ok := ret.Get(0).(func(context.Context, string, string, model.WebhookReferenceObjectType) []*model.Webhook); ok { 120 r0 = rf(ctx, tenant, objID, objType) 121 } else { 122 if ret.Get(0) != nil { 123 r0 = ret.Get(0).([]*model.Webhook) 124 } 125 } 126 127 var r1 error 128 if rf, ok := ret.Get(1).(func(context.Context, string, string, model.WebhookReferenceObjectType) error); ok { 129 r1 = rf(ctx, tenant, objID, objType) 130 } else { 131 r1 = ret.Error(1) 132 } 133 134 return r0, r1 135 } 136 137 // ListByReferenceObjectIDGlobal provides a mock function with given fields: ctx, objID, objType 138 func (_m *WebhookRepository) ListByReferenceObjectIDGlobal(ctx context.Context, objID string, objType model.WebhookReferenceObjectType) ([]*model.Webhook, error) { 139 ret := _m.Called(ctx, objID, objType) 140 141 var r0 []*model.Webhook 142 if rf, ok := ret.Get(0).(func(context.Context, string, model.WebhookReferenceObjectType) []*model.Webhook); ok { 143 r0 = rf(ctx, objID, objType) 144 } else { 145 if ret.Get(0) != nil { 146 r0 = ret.Get(0).([]*model.Webhook) 147 } 148 } 149 150 var r1 error 151 if rf, ok := ret.Get(1).(func(context.Context, string, model.WebhookReferenceObjectType) error); ok { 152 r1 = rf(ctx, objID, objType) 153 } else { 154 r1 = ret.Error(1) 155 } 156 157 return r0, r1 158 } 159 160 // ListByWebhookType provides a mock function with given fields: ctx, webhookType 161 func (_m *WebhookRepository) ListByWebhookType(ctx context.Context, webhookType model.WebhookType) ([]*model.Webhook, error) { 162 ret := _m.Called(ctx, webhookType) 163 164 var r0 []*model.Webhook 165 if rf, ok := ret.Get(0).(func(context.Context, model.WebhookType) []*model.Webhook); ok { 166 r0 = rf(ctx, webhookType) 167 } else { 168 if ret.Get(0) != nil { 169 r0 = ret.Get(0).([]*model.Webhook) 170 } 171 } 172 173 var r1 error 174 if rf, ok := ret.Get(1).(func(context.Context, model.WebhookType) error); ok { 175 r1 = rf(ctx, webhookType) 176 } else { 177 r1 = ret.Error(1) 178 } 179 180 return r0, r1 181 } 182 183 // Update provides a mock function with given fields: ctx, tenant, item 184 func (_m *WebhookRepository) Update(ctx context.Context, tenant string, item *model.Webhook) error { 185 ret := _m.Called(ctx, tenant, item) 186 187 var r0 error 188 if rf, ok := ret.Get(0).(func(context.Context, string, *model.Webhook) error); ok { 189 r0 = rf(ctx, tenant, item) 190 } else { 191 r0 = ret.Error(0) 192 } 193 194 return r0 195 } 196 197 type mockConstructorTestingTNewWebhookRepository interface { 198 mock.TestingT 199 Cleanup(func()) 200 } 201 202 // NewWebhookRepository creates a new instance of WebhookRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 203 func NewWebhookRepository(t mockConstructorTestingTNewWebhookRepository) *WebhookRepository { 204 mock := &WebhookRepository{} 205 mock.Mock.Test(t) 206 207 t.Cleanup(func() { mock.AssertExpectations(t) }) 208 209 return mock 210 }