github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/application/automock/application_service.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 // ApplicationService is an autogenerated mock type for the ApplicationService type 17 type ApplicationService struct { 18 mock.Mock 19 } 20 21 // Create provides a mock function with given fields: ctx, in 22 func (_m *ApplicationService) Create(ctx context.Context, in model.ApplicationRegisterInput) (string, error) { 23 ret := _m.Called(ctx, in) 24 25 var r0 string 26 if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationRegisterInput) string); ok { 27 r0 = rf(ctx, in) 28 } else { 29 r0 = ret.Get(0).(string) 30 } 31 32 var r1 error 33 if rf, ok := ret.Get(1).(func(context.Context, model.ApplicationRegisterInput) error); ok { 34 r1 = rf(ctx, in) 35 } else { 36 r1 = ret.Error(1) 37 } 38 39 return r0, r1 40 } 41 42 // Delete provides a mock function with given fields: ctx, id 43 func (_m *ApplicationService) Delete(ctx context.Context, id string) error { 44 ret := _m.Called(ctx, id) 45 46 var r0 error 47 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 48 r0 = rf(ctx, id) 49 } else { 50 r0 = ret.Error(0) 51 } 52 53 return r0 54 } 55 56 // DeleteLabel provides a mock function with given fields: ctx, applicationID, key 57 func (_m *ApplicationService) DeleteLabel(ctx context.Context, applicationID string, key string) error { 58 ret := _m.Called(ctx, applicationID, key) 59 60 var r0 error 61 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 62 r0 = rf(ctx, applicationID, key) 63 } else { 64 r0 = ret.Error(0) 65 } 66 67 return r0 68 } 69 70 // Get provides a mock function with given fields: ctx, id 71 func (_m *ApplicationService) Get(ctx context.Context, id string) (*model.Application, error) { 72 ret := _m.Called(ctx, id) 73 74 var r0 *model.Application 75 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Application); ok { 76 r0 = rf(ctx, id) 77 } else { 78 if ret.Get(0) != nil { 79 r0 = ret.Get(0).(*model.Application) 80 } 81 } 82 83 var r1 error 84 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 85 r1 = rf(ctx, id) 86 } else { 87 r1 = ret.Error(1) 88 } 89 90 return r0, r1 91 } 92 93 // GetBySystemNumber provides a mock function with given fields: ctx, systemNumber 94 func (_m *ApplicationService) GetBySystemNumber(ctx context.Context, systemNumber string) (*model.Application, error) { 95 ret := _m.Called(ctx, systemNumber) 96 97 var r0 *model.Application 98 if rf, ok := ret.Get(0).(func(context.Context, string) *model.Application); ok { 99 r0 = rf(ctx, systemNumber) 100 } else { 101 if ret.Get(0) != nil { 102 r0 = ret.Get(0).(*model.Application) 103 } 104 } 105 106 var r1 error 107 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 108 r1 = rf(ctx, systemNumber) 109 } else { 110 r1 = ret.Error(1) 111 } 112 113 return r0, r1 114 } 115 116 // GetLabel provides a mock function with given fields: ctx, applicationID, key 117 func (_m *ApplicationService) GetLabel(ctx context.Context, applicationID string, key string) (*model.Label, error) { 118 ret := _m.Called(ctx, applicationID, key) 119 120 var r0 *model.Label 121 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Label); ok { 122 r0 = rf(ctx, applicationID, key) 123 } else { 124 if ret.Get(0) != nil { 125 r0 = ret.Get(0).(*model.Label) 126 } 127 } 128 129 var r1 error 130 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 131 r1 = rf(ctx, applicationID, key) 132 } else { 133 r1 = ret.Error(1) 134 } 135 136 return r0, r1 137 } 138 139 // List provides a mock function with given fields: ctx, filter, pageSize, cursor 140 func (_m *ApplicationService) List(ctx context.Context, filter []*labelfilter.LabelFilter, pageSize int, cursor string) (*model.ApplicationPage, error) { 141 ret := _m.Called(ctx, filter, pageSize, cursor) 142 143 var r0 *model.ApplicationPage 144 if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter, int, string) *model.ApplicationPage); ok { 145 r0 = rf(ctx, filter, pageSize, cursor) 146 } else { 147 if ret.Get(0) != nil { 148 r0 = ret.Get(0).(*model.ApplicationPage) 149 } 150 } 151 152 var r1 error 153 if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter, int, string) error); ok { 154 r1 = rf(ctx, filter, pageSize, cursor) 155 } else { 156 r1 = ret.Error(1) 157 } 158 159 return r0, r1 160 } 161 162 // ListAll provides a mock function with given fields: ctx 163 func (_m *ApplicationService) ListAll(ctx context.Context) ([]*model.Application, error) { 164 ret := _m.Called(ctx) 165 166 var r0 []*model.Application 167 if rf, ok := ret.Get(0).(func(context.Context) []*model.Application); ok { 168 r0 = rf(ctx) 169 } else { 170 if ret.Get(0) != nil { 171 r0 = ret.Get(0).([]*model.Application) 172 } 173 } 174 175 var r1 error 176 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 177 r1 = rf(ctx) 178 } else { 179 r1 = ret.Error(1) 180 } 181 182 return r0, r1 183 } 184 185 // ListByRuntimeID provides a mock function with given fields: ctx, runtimeUUID, pageSize, cursor 186 func (_m *ApplicationService) ListByRuntimeID(ctx context.Context, runtimeUUID uuid.UUID, pageSize int, cursor string) (*model.ApplicationPage, error) { 187 ret := _m.Called(ctx, runtimeUUID, pageSize, cursor) 188 189 var r0 *model.ApplicationPage 190 if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, int, string) *model.ApplicationPage); ok { 191 r0 = rf(ctx, runtimeUUID, pageSize, cursor) 192 } else { 193 if ret.Get(0) != nil { 194 r0 = ret.Get(0).(*model.ApplicationPage) 195 } 196 } 197 198 var r1 error 199 if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID, int, string) error); ok { 200 r1 = rf(ctx, runtimeUUID, pageSize, cursor) 201 } else { 202 r1 = ret.Error(1) 203 } 204 205 return r0, r1 206 } 207 208 // ListLabels provides a mock function with given fields: ctx, applicationID 209 func (_m *ApplicationService) ListLabels(ctx context.Context, applicationID string) (map[string]*model.Label, error) { 210 ret := _m.Called(ctx, applicationID) 211 212 var r0 map[string]*model.Label 213 if rf, ok := ret.Get(0).(func(context.Context, string) map[string]*model.Label); ok { 214 r0 = rf(ctx, applicationID) 215 } else { 216 if ret.Get(0) != nil { 217 r0 = ret.Get(0).(map[string]*model.Label) 218 } 219 } 220 221 var r1 error 222 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 223 r1 = rf(ctx, applicationID) 224 } else { 225 r1 = ret.Error(1) 226 } 227 228 return r0, r1 229 } 230 231 // Merge provides a mock function with given fields: ctx, destID, sourceID 232 func (_m *ApplicationService) Merge(ctx context.Context, destID string, sourceID string) (*model.Application, error) { 233 ret := _m.Called(ctx, destID, sourceID) 234 235 var r0 *model.Application 236 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Application); ok { 237 r0 = rf(ctx, destID, sourceID) 238 } else { 239 if ret.Get(0) != nil { 240 r0 = ret.Get(0).(*model.Application) 241 } 242 } 243 244 var r1 error 245 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 246 r1 = rf(ctx, destID, sourceID) 247 } else { 248 r1 = ret.Error(1) 249 } 250 251 return r0, r1 252 } 253 254 // SetLabel provides a mock function with given fields: ctx, label 255 func (_m *ApplicationService) SetLabel(ctx context.Context, label *model.LabelInput) error { 256 ret := _m.Called(ctx, label) 257 258 var r0 error 259 if rf, ok := ret.Get(0).(func(context.Context, *model.LabelInput) error); ok { 260 r0 = rf(ctx, label) 261 } else { 262 r0 = ret.Error(0) 263 } 264 265 return r0 266 } 267 268 // Unpair provides a mock function with given fields: ctx, id 269 func (_m *ApplicationService) Unpair(ctx context.Context, id string) error { 270 ret := _m.Called(ctx, id) 271 272 var r0 error 273 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 274 r0 = rf(ctx, id) 275 } else { 276 r0 = ret.Error(0) 277 } 278 279 return r0 280 } 281 282 // Update provides a mock function with given fields: ctx, id, in 283 func (_m *ApplicationService) Update(ctx context.Context, id string, in model.ApplicationUpdateInput) error { 284 ret := _m.Called(ctx, id, in) 285 286 var r0 error 287 if rf, ok := ret.Get(0).(func(context.Context, string, model.ApplicationUpdateInput) error); ok { 288 r0 = rf(ctx, id, in) 289 } else { 290 r0 = ret.Error(0) 291 } 292 293 return r0 294 } 295 296 type mockConstructorTestingTNewApplicationService interface { 297 mock.TestingT 298 Cleanup(func()) 299 } 300 301 // NewApplicationService creates a new instance of ApplicationService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 302 func NewApplicationService(t mockConstructorTestingTNewApplicationService) *ApplicationService { 303 mock := &ApplicationService{} 304 mock.Mock.Test(t) 305 306 t.Cleanup(func() { mock.AssertExpectations(t) }) 307 308 return mock 309 }