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