• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 1494786857

14 Oct 2024 10:01AM UTC coverage: 72.891% (-1.2%) from 74.094%
1494786857

Pull #100

gitlab-ci

tranchitella
chore: centralize the mock generator across the different services

Changelog: None
Ticket: None

Signed-off-by: Fabio Tranchitella <fabio@tranchitella.eu>
Pull Request #100: chore: centralize the mock generator across the different services

4399 of 6347 branches covered (69.31%)

Branch coverage included in aggregate %.

722 of 2034 new or added lines in 44 files covered. (35.5%)

197 existing lines in 36 files now uncovered.

42530 of 58035 relevant lines covered (73.28%)

28.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.47
/backend/services/inventory/inv/mocks/InventoryApp.go
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
// Code generated by mockery v2.45.1. DO NOT EDIT.
16

17
package mocks
18

19
import (
20
        context "context"
21

22
        devicemonitor "github.com/mendersoftware/mender-server/services/inventory/client/devicemonitor"
23
        inv "github.com/mendersoftware/mender-server/services/inventory/inv"
24

25
        mock "github.com/stretchr/testify/mock"
26

27
        model "github.com/mendersoftware/mender-server/services/inventory/model"
28

29
        store "github.com/mendersoftware/mender-server/services/inventory/store"
30

31
        workflows "github.com/mendersoftware/mender-server/services/inventory/client/workflows"
32
)
33

34
// InventoryApp is an autogenerated mock type for the InventoryApp type
35
type InventoryApp struct {
36
        mock.Mock
37
}
38

39
// AddDevice provides a mock function with given fields: ctx, d
40
func (_m *InventoryApp) AddDevice(ctx context.Context, d *model.Device) error {
1✔
41
        ret := _m.Called(ctx, d)
1✔
42

1✔
43
        if len(ret) == 0 {
1✔
NEW
44
                panic("no return value specified for AddDevice")
×
45
        }
46

47
        var r0 error
1✔
48
        if rf, ok := ret.Get(0).(func(context.Context, *model.Device) error); ok {
1✔
49
                r0 = rf(ctx, d)
×
50
        } else {
1✔
51
                r0 = ret.Error(0)
1✔
52
        }
1✔
53

54
        return r0
1✔
55
}
56

57
// CheckAlerts provides a mock function with given fields: ctx, deviceId
58
func (_m *InventoryApp) CheckAlerts(ctx context.Context, deviceId string) (int, error) {
1✔
59
        ret := _m.Called(ctx, deviceId)
1✔
60

1✔
61
        if len(ret) == 0 {
1✔
NEW
62
                panic("no return value specified for CheckAlerts")
×
63
        }
64

65
        var r0 int
1✔
66
        var r1 error
1✔
67
        if rf, ok := ret.Get(0).(func(context.Context, string) (int, error)); ok {
1✔
NEW
68
                return rf(ctx, deviceId)
×
NEW
69
        }
×
70
        if rf, ok := ret.Get(0).(func(context.Context, string) int); ok {
1✔
71
                r0 = rf(ctx, deviceId)
×
72
        } else {
1✔
73
                r0 = ret.Get(0).(int)
1✔
74
        }
1✔
75

76
        if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
1✔
UNCOV
77
                r1 = rf(ctx, deviceId)
×
78
        } else {
1✔
79
                r1 = ret.Error(1)
1✔
80
        }
1✔
81

82
        return r0, r1
1✔
83
}
84

85
// CreateTenant provides a mock function with given fields: ctx, tenant
86
func (_m *InventoryApp) CreateTenant(ctx context.Context, tenant model.NewTenant) error {
1✔
87
        ret := _m.Called(ctx, tenant)
1✔
88

1✔
89
        if len(ret) == 0 {
1✔
NEW
90
                panic("no return value specified for CreateTenant")
×
91
        }
92

93
        var r0 error
1✔
94
        if rf, ok := ret.Get(0).(func(context.Context, model.NewTenant) error); ok {
1✔
95
                r0 = rf(ctx, tenant)
×
96
        } else {
1✔
97
                r0 = ret.Error(0)
1✔
98
        }
1✔
99

100
        return r0
1✔
101
}
102

103
// DeleteDevice provides a mock function with given fields: ctx, id
104
func (_m *InventoryApp) DeleteDevice(ctx context.Context, id model.DeviceID) error {
1✔
105
        ret := _m.Called(ctx, id)
1✔
106

1✔
107
        if len(ret) == 0 {
1✔
NEW
108
                panic("no return value specified for DeleteDevice")
×
109
        }
110

111
        var r0 error
1✔
112
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID) error); ok {
1✔
113
                r0 = rf(ctx, id)
×
114
        } else {
1✔
115
                r0 = ret.Error(0)
1✔
116
        }
1✔
117

118
        return r0
1✔
119
}
120

121
// DeleteDevices provides a mock function with given fields: ctx, ids
122
func (_m *InventoryApp) DeleteDevices(ctx context.Context, ids []model.DeviceID) (*model.UpdateResult, error) {
×
123
        ret := _m.Called(ctx, ids)
×
124

×
NEW
125
        if len(ret) == 0 {
×
NEW
126
                panic("no return value specified for DeleteDevices")
×
127
        }
128

129
        var r0 *model.UpdateResult
×
NEW
130
        var r1 error
×
NEW
131
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID) (*model.UpdateResult, error)); ok {
×
NEW
132
                return rf(ctx, ids)
×
NEW
133
        }
×
134
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID) *model.UpdateResult); ok {
×
135
                r0 = rf(ctx, ids)
×
136
        } else {
×
137
                if ret.Get(0) != nil {
×
138
                        r0 = ret.Get(0).(*model.UpdateResult)
×
139
                }
×
140
        }
141

142
        if rf, ok := ret.Get(1).(func(context.Context, []model.DeviceID) error); ok {
×
143
                r1 = rf(ctx, ids)
×
144
        } else {
×
145
                r1 = ret.Error(1)
×
146
        }
×
147

148
        return r0, r1
×
149
}
150

151
// DeleteGroup provides a mock function with given fields: ctx, groupName
152
func (_m *InventoryApp) DeleteGroup(ctx context.Context, groupName model.GroupName) (*model.UpdateResult, error) {
1✔
153
        ret := _m.Called(ctx, groupName)
1✔
154

1✔
155
        if len(ret) == 0 {
1✔
NEW
156
                panic("no return value specified for DeleteGroup")
×
157
        }
158

159
        var r0 *model.UpdateResult
1✔
160
        var r1 error
1✔
161
        if rf, ok := ret.Get(0).(func(context.Context, model.GroupName) (*model.UpdateResult, error)); ok {
1✔
NEW
162
                return rf(ctx, groupName)
×
NEW
163
        }
×
164
        if rf, ok := ret.Get(0).(func(context.Context, model.GroupName) *model.UpdateResult); ok {
1✔
165
                r0 = rf(ctx, groupName)
×
166
        } else {
1✔
167
                if ret.Get(0) != nil {
2✔
168
                        r0 = ret.Get(0).(*model.UpdateResult)
1✔
169
                }
1✔
170
        }
171

172
        if rf, ok := ret.Get(1).(func(context.Context, model.GroupName) error); ok {
1✔
UNCOV
173
                r1 = rf(ctx, groupName)
×
174
        } else {
1✔
175
                r1 = ret.Error(1)
1✔
176
        }
1✔
177

178
        return r0, r1
1✔
179
}
180

181
// GetDevice provides a mock function with given fields: ctx, id
182
func (_m *InventoryApp) GetDevice(ctx context.Context, id model.DeviceID) (*model.Device, error) {
1✔
183
        ret := _m.Called(ctx, id)
1✔
184

1✔
185
        if len(ret) == 0 {
1✔
NEW
186
                panic("no return value specified for GetDevice")
×
187
        }
188

189
        var r0 *model.Device
1✔
190
        var r1 error
1✔
191
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID) (*model.Device, error)); ok {
1✔
NEW
192
                return rf(ctx, id)
×
NEW
193
        }
×
194
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID) *model.Device); ok {
1✔
195
                r0 = rf(ctx, id)
×
196
        } else {
1✔
197
                if ret.Get(0) != nil {
2✔
198
                        r0 = ret.Get(0).(*model.Device)
1✔
199
                }
1✔
200
        }
201

202
        if rf, ok := ret.Get(1).(func(context.Context, model.DeviceID) error); ok {
1✔
UNCOV
203
                r1 = rf(ctx, id)
×
204
        } else {
1✔
205
                r1 = ret.Error(1)
1✔
206
        }
1✔
207

208
        return r0, r1
1✔
209
}
210

211
// GetDeviceGroup provides a mock function with given fields: ctx, id
212
func (_m *InventoryApp) GetDeviceGroup(ctx context.Context, id model.DeviceID) (model.GroupName, error) {
1✔
213
        ret := _m.Called(ctx, id)
1✔
214

1✔
215
        if len(ret) == 0 {
1✔
NEW
216
                panic("no return value specified for GetDeviceGroup")
×
217
        }
218

219
        var r0 model.GroupName
1✔
220
        var r1 error
1✔
221
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID) (model.GroupName, error)); ok {
1✔
NEW
222
                return rf(ctx, id)
×
NEW
223
        }
×
224
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID) model.GroupName); ok {
1✔
225
                r0 = rf(ctx, id)
×
226
        } else {
1✔
227
                r0 = ret.Get(0).(model.GroupName)
1✔
228
        }
1✔
229

230
        if rf, ok := ret.Get(1).(func(context.Context, model.DeviceID) error); ok {
1✔
UNCOV
231
                r1 = rf(ctx, id)
×
232
        } else {
1✔
233
                r1 = ret.Error(1)
1✔
234
        }
1✔
235

236
        return r0, r1
1✔
237
}
238

239
// GetFiltersAttributes provides a mock function with given fields: ctx
240
func (_m *InventoryApp) GetFiltersAttributes(ctx context.Context) ([]model.FilterAttribute, error) {
1✔
241
        ret := _m.Called(ctx)
1✔
242

1✔
243
        if len(ret) == 0 {
1✔
NEW
244
                panic("no return value specified for GetFiltersAttributes")
×
245
        }
246

247
        var r0 []model.FilterAttribute
1✔
248
        var r1 error
1✔
249
        if rf, ok := ret.Get(0).(func(context.Context) ([]model.FilterAttribute, error)); ok {
1✔
NEW
250
                return rf(ctx)
×
NEW
251
        }
×
252
        if rf, ok := ret.Get(0).(func(context.Context) []model.FilterAttribute); ok {
1✔
253
                r0 = rf(ctx)
×
254
        } else {
1✔
255
                if ret.Get(0) != nil {
2✔
256
                        r0 = ret.Get(0).([]model.FilterAttribute)
1✔
257
                }
1✔
258
        }
259

260
        if rf, ok := ret.Get(1).(func(context.Context) error); ok {
1✔
UNCOV
261
                r1 = rf(ctx)
×
262
        } else {
1✔
263
                r1 = ret.Error(1)
1✔
264
        }
1✔
265

266
        return r0, r1
1✔
267
}
268

269
// HealthCheck provides a mock function with given fields: ctx
270
func (_m *InventoryApp) HealthCheck(ctx context.Context) error {
1✔
271
        ret := _m.Called(ctx)
1✔
272

1✔
273
        if len(ret) == 0 {
1✔
NEW
274
                panic("no return value specified for HealthCheck")
×
275
        }
276

277
        var r0 error
1✔
278
        if rf, ok := ret.Get(0).(func(context.Context) error); ok {
1✔
279
                r0 = rf(ctx)
×
280
        } else {
1✔
281
                r0 = ret.Error(0)
1✔
282
        }
1✔
283

284
        return r0
1✔
285
}
286

287
// ListDevices provides a mock function with given fields: ctx, q
288
func (_m *InventoryApp) ListDevices(ctx context.Context, q store.ListQuery) ([]model.Device, int, error) {
1✔
289
        ret := _m.Called(ctx, q)
1✔
290

1✔
291
        if len(ret) == 0 {
1✔
NEW
292
                panic("no return value specified for ListDevices")
×
293
        }
294

295
        var r0 []model.Device
1✔
296
        var r1 int
1✔
297
        var r2 error
1✔
298
        if rf, ok := ret.Get(0).(func(context.Context, store.ListQuery) ([]model.Device, int, error)); ok {
1✔
NEW
299
                return rf(ctx, q)
×
NEW
300
        }
×
301
        if rf, ok := ret.Get(0).(func(context.Context, store.ListQuery) []model.Device); ok {
1✔
302
                r0 = rf(ctx, q)
×
303
        } else {
1✔
304
                if ret.Get(0) != nil {
2✔
305
                        r0 = ret.Get(0).([]model.Device)
1✔
306
                }
1✔
307
        }
308

309
        if rf, ok := ret.Get(1).(func(context.Context, store.ListQuery) int); ok {
1✔
UNCOV
310
                r1 = rf(ctx, q)
×
311
        } else {
1✔
312
                r1 = ret.Get(1).(int)
1✔
313
        }
1✔
314

315
        if rf, ok := ret.Get(2).(func(context.Context, store.ListQuery) error); ok {
1✔
UNCOV
316
                r2 = rf(ctx, q)
×
317
        } else {
1✔
318
                r2 = ret.Error(2)
1✔
319
        }
1✔
320

321
        return r0, r1, r2
1✔
322
}
323

324
// ListDevicesByGroup provides a mock function with given fields: ctx, group, skip, limit
325
func (_m *InventoryApp) ListDevicesByGroup(ctx context.Context, group model.GroupName, skip int, limit int) ([]model.DeviceID, int, error) {
1✔
326
        ret := _m.Called(ctx, group, skip, limit)
1✔
327

1✔
328
        if len(ret) == 0 {
1✔
NEW
329
                panic("no return value specified for ListDevicesByGroup")
×
330
        }
331

332
        var r0 []model.DeviceID
1✔
333
        var r1 int
1✔
334
        var r2 error
1✔
335
        if rf, ok := ret.Get(0).(func(context.Context, model.GroupName, int, int) ([]model.DeviceID, int, error)); ok {
1✔
NEW
336
                return rf(ctx, group, skip, limit)
×
NEW
337
        }
×
338
        if rf, ok := ret.Get(0).(func(context.Context, model.GroupName, int, int) []model.DeviceID); ok {
1✔
339
                r0 = rf(ctx, group, skip, limit)
×
340
        } else {
1✔
341
                if ret.Get(0) != nil {
2✔
342
                        r0 = ret.Get(0).([]model.DeviceID)
1✔
343
                }
1✔
344
        }
345

346
        if rf, ok := ret.Get(1).(func(context.Context, model.GroupName, int, int) int); ok {
1✔
UNCOV
347
                r1 = rf(ctx, group, skip, limit)
×
348
        } else {
1✔
349
                r1 = ret.Get(1).(int)
1✔
350
        }
1✔
351

352
        if rf, ok := ret.Get(2).(func(context.Context, model.GroupName, int, int) error); ok {
1✔
UNCOV
353
                r2 = rf(ctx, group, skip, limit)
×
354
        } else {
1✔
355
                r2 = ret.Error(2)
1✔
356
        }
1✔
357

358
        return r0, r1, r2
1✔
359
}
360

361
// ListGroups provides a mock function with given fields: ctx, filters
362
func (_m *InventoryApp) ListGroups(ctx context.Context, filters []model.FilterPredicate) ([]model.GroupName, error) {
1✔
363
        ret := _m.Called(ctx, filters)
1✔
364

1✔
365
        if len(ret) == 0 {
1✔
NEW
366
                panic("no return value specified for ListGroups")
×
367
        }
368

369
        var r0 []model.GroupName
1✔
370
        var r1 error
1✔
371
        if rf, ok := ret.Get(0).(func(context.Context, []model.FilterPredicate) ([]model.GroupName, error)); ok {
1✔
NEW
372
                return rf(ctx, filters)
×
NEW
373
        }
×
374
        if rf, ok := ret.Get(0).(func(context.Context, []model.FilterPredicate) []model.GroupName); ok {
1✔
375
                r0 = rf(ctx, filters)
×
376
        } else {
1✔
377
                if ret.Get(0) != nil {
2✔
378
                        r0 = ret.Get(0).([]model.GroupName)
1✔
379
                }
1✔
380
        }
381

382
        if rf, ok := ret.Get(1).(func(context.Context, []model.FilterPredicate) error); ok {
1✔
UNCOV
383
                r1 = rf(ctx, filters)
×
384
        } else {
1✔
385
                r1 = ret.Error(1)
1✔
386
        }
1✔
387

388
        return r0, r1
1✔
389
}
390

391
// ReplaceAttributes provides a mock function with given fields: ctx, id, upsertAttrs, scope, etag
392
func (_m *InventoryApp) ReplaceAttributes(ctx context.Context, id model.DeviceID, upsertAttrs model.DeviceAttributes, scope string, etag string) error {
1✔
393
        ret := _m.Called(ctx, id, upsertAttrs, scope, etag)
1✔
394

1✔
395
        if len(ret) == 0 {
1✔
NEW
396
                panic("no return value specified for ReplaceAttributes")
×
397
        }
398

399
        var r0 error
1✔
400
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID, model.DeviceAttributes, string, string) error); ok {
1✔
401
                r0 = rf(ctx, id, upsertAttrs, scope, etag)
×
402
        } else {
1✔
403
                r0 = ret.Error(0)
1✔
404
        }
1✔
405

406
        return r0
1✔
407
}
408

409
// SearchDevices provides a mock function with given fields: ctx, searchParams
410
func (_m *InventoryApp) SearchDevices(ctx context.Context, searchParams model.SearchParams) ([]model.Device, int, error) {
1✔
411
        ret := _m.Called(ctx, searchParams)
1✔
412

1✔
413
        if len(ret) == 0 {
1✔
NEW
414
                panic("no return value specified for SearchDevices")
×
415
        }
416

417
        var r0 []model.Device
1✔
418
        var r1 int
1✔
419
        var r2 error
1✔
420
        if rf, ok := ret.Get(0).(func(context.Context, model.SearchParams) ([]model.Device, int, error)); ok {
1✔
NEW
421
                return rf(ctx, searchParams)
×
NEW
422
        }
×
423
        if rf, ok := ret.Get(0).(func(context.Context, model.SearchParams) []model.Device); ok {
1✔
424
                r0 = rf(ctx, searchParams)
×
425
        } else {
1✔
426
                if ret.Get(0) != nil {
2✔
427
                        r0 = ret.Get(0).([]model.Device)
1✔
428
                }
1✔
429
        }
430

431
        if rf, ok := ret.Get(1).(func(context.Context, model.SearchParams) int); ok {
1✔
UNCOV
432
                r1 = rf(ctx, searchParams)
×
433
        } else {
1✔
434
                r1 = ret.Get(1).(int)
1✔
435
        }
1✔
436

437
        if rf, ok := ret.Get(2).(func(context.Context, model.SearchParams) error); ok {
1✔
UNCOV
438
                r2 = rf(ctx, searchParams)
×
439
        } else {
1✔
440
                r2 = ret.Error(2)
1✔
441
        }
1✔
442

443
        return r0, r1, r2
1✔
444
}
445

446
// UnsetDeviceGroup provides a mock function with given fields: ctx, id, groupName
447
func (_m *InventoryApp) UnsetDeviceGroup(ctx context.Context, id model.DeviceID, groupName model.GroupName) error {
1✔
448
        ret := _m.Called(ctx, id, groupName)
1✔
449

1✔
450
        if len(ret) == 0 {
1✔
NEW
451
                panic("no return value specified for UnsetDeviceGroup")
×
452
        }
453

454
        var r0 error
1✔
455
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID, model.GroupName) error); ok {
1✔
456
                r0 = rf(ctx, id, groupName)
×
457
        } else {
1✔
458
                r0 = ret.Error(0)
1✔
459
        }
1✔
460

461
        return r0
1✔
462
}
463

464
// UnsetDevicesGroup provides a mock function with given fields: ctx, deviceIDs, groupName
465
func (_m *InventoryApp) UnsetDevicesGroup(ctx context.Context, deviceIDs []model.DeviceID, groupName model.GroupName) (*model.UpdateResult, error) {
1✔
466
        ret := _m.Called(ctx, deviceIDs, groupName)
1✔
467

1✔
468
        if len(ret) == 0 {
1✔
NEW
469
                panic("no return value specified for UnsetDevicesGroup")
×
470
        }
471

472
        var r0 *model.UpdateResult
1✔
473
        var r1 error
1✔
474
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID, model.GroupName) (*model.UpdateResult, error)); ok {
1✔
NEW
475
                return rf(ctx, deviceIDs, groupName)
×
NEW
476
        }
×
477
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID, model.GroupName) *model.UpdateResult); ok {
1✔
478
                r0 = rf(ctx, deviceIDs, groupName)
×
479
        } else {
1✔
480
                if ret.Get(0) != nil {
2✔
481
                        r0 = ret.Get(0).(*model.UpdateResult)
1✔
482
                }
1✔
483
        }
484

485
        if rf, ok := ret.Get(1).(func(context.Context, []model.DeviceID, model.GroupName) error); ok {
1✔
UNCOV
486
                r1 = rf(ctx, deviceIDs, groupName)
×
487
        } else {
1✔
488
                r1 = ret.Error(1)
1✔
489
        }
1✔
490

491
        return r0, r1
1✔
492
}
493

494
// UpdateDeviceGroup provides a mock function with given fields: ctx, id, group
495
func (_m *InventoryApp) UpdateDeviceGroup(ctx context.Context, id model.DeviceID, group model.GroupName) error {
1✔
496
        ret := _m.Called(ctx, id, group)
1✔
497

1✔
498
        if len(ret) == 0 {
1✔
NEW
499
                panic("no return value specified for UpdateDeviceGroup")
×
500
        }
501

502
        var r0 error
1✔
503
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID, model.GroupName) error); ok {
1✔
504
                r0 = rf(ctx, id, group)
×
505
        } else {
1✔
506
                r0 = ret.Error(0)
1✔
507
        }
1✔
508

509
        return r0
1✔
510
}
511

512
// UpdateDevicesGroup provides a mock function with given fields: ctx, ids, group
513
func (_m *InventoryApp) UpdateDevicesGroup(ctx context.Context, ids []model.DeviceID, group model.GroupName) (*model.UpdateResult, error) {
1✔
514
        ret := _m.Called(ctx, ids, group)
1✔
515

1✔
516
        if len(ret) == 0 {
1✔
NEW
517
                panic("no return value specified for UpdateDevicesGroup")
×
518
        }
519

520
        var r0 *model.UpdateResult
1✔
521
        var r1 error
1✔
522
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID, model.GroupName) (*model.UpdateResult, error)); ok {
1✔
NEW
523
                return rf(ctx, ids, group)
×
NEW
524
        }
×
525
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceID, model.GroupName) *model.UpdateResult); ok {
1✔
526
                r0 = rf(ctx, ids, group)
×
527
        } else {
1✔
528
                if ret.Get(0) != nil {
2✔
529
                        r0 = ret.Get(0).(*model.UpdateResult)
1✔
530
                }
1✔
531
        }
532

533
        if rf, ok := ret.Get(1).(func(context.Context, []model.DeviceID, model.GroupName) error); ok {
1✔
UNCOV
534
                r1 = rf(ctx, ids, group)
×
535
        } else {
1✔
536
                r1 = ret.Error(1)
1✔
537
        }
1✔
538

539
        return r0, r1
1✔
540
}
541

542
// UpsertAttributes provides a mock function with given fields: ctx, id, attrs
543
func (_m *InventoryApp) UpsertAttributes(ctx context.Context, id model.DeviceID, attrs model.DeviceAttributes) error {
1✔
544
        ret := _m.Called(ctx, id, attrs)
1✔
545

1✔
546
        if len(ret) == 0 {
1✔
NEW
547
                panic("no return value specified for UpsertAttributes")
×
548
        }
549

550
        var r0 error
1✔
551
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID, model.DeviceAttributes) error); ok {
1✔
552
                r0 = rf(ctx, id, attrs)
×
553
        } else {
1✔
554
                r0 = ret.Error(0)
1✔
555
        }
1✔
556

557
        return r0
1✔
558
}
559

560
// UpsertAttributesWithUpdated provides a mock function with given fields: ctx, id, attrs, scope, etag
561
func (_m *InventoryApp) UpsertAttributesWithUpdated(ctx context.Context, id model.DeviceID, attrs model.DeviceAttributes, scope string, etag string) error {
1✔
562
        ret := _m.Called(ctx, id, attrs, scope, etag)
1✔
563

1✔
564
        if len(ret) == 0 {
1✔
NEW
565
                panic("no return value specified for UpsertAttributesWithUpdated")
×
566
        }
567

568
        var r0 error
1✔
569
        if rf, ok := ret.Get(0).(func(context.Context, model.DeviceID, model.DeviceAttributes, string, string) error); ok {
1✔
570
                r0 = rf(ctx, id, attrs, scope, etag)
×
571
        } else {
1✔
572
                r0 = ret.Error(0)
1✔
573
        }
1✔
574

575
        return r0
1✔
576
}
577

578
// UpsertDevicesStatuses provides a mock function with given fields: ctx, devices, attrs
579
func (_m *InventoryApp) UpsertDevicesStatuses(ctx context.Context, devices []model.DeviceUpdate, attrs model.DeviceAttributes) (*model.UpdateResult, error) {
1✔
580
        ret := _m.Called(ctx, devices, attrs)
1✔
581

1✔
582
        if len(ret) == 0 {
1✔
NEW
583
                panic("no return value specified for UpsertDevicesStatuses")
×
584
        }
585

586
        var r0 *model.UpdateResult
1✔
587
        var r1 error
1✔
588
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceUpdate, model.DeviceAttributes) (*model.UpdateResult, error)); ok {
1✔
NEW
589
                return rf(ctx, devices, attrs)
×
NEW
590
        }
×
591
        if rf, ok := ret.Get(0).(func(context.Context, []model.DeviceUpdate, model.DeviceAttributes) *model.UpdateResult); ok {
1✔
592
                r0 = rf(ctx, devices, attrs)
×
593
        } else {
1✔
594
                if ret.Get(0) != nil {
2✔
595
                        r0 = ret.Get(0).(*model.UpdateResult)
1✔
596
                }
1✔
597
        }
598

599
        if rf, ok := ret.Get(1).(func(context.Context, []model.DeviceUpdate, model.DeviceAttributes) error); ok {
1✔
UNCOV
600
                r1 = rf(ctx, devices, attrs)
×
601
        } else {
1✔
602
                r1 = ret.Error(1)
1✔
603
        }
1✔
604

605
        return r0, r1
1✔
606
}
607

608
// WithDevicemonitor provides a mock function with given fields: client
609
func (_m *InventoryApp) WithDevicemonitor(client devicemonitor.Client) inv.InventoryApp {
×
610
        ret := _m.Called(client)
×
611

×
NEW
612
        if len(ret) == 0 {
×
NEW
613
                panic("no return value specified for WithDevicemonitor")
×
614
        }
615

616
        var r0 inv.InventoryApp
×
617
        if rf, ok := ret.Get(0).(func(devicemonitor.Client) inv.InventoryApp); ok {
×
618
                r0 = rf(client)
×
619
        } else {
×
620
                if ret.Get(0) != nil {
×
621
                        r0 = ret.Get(0).(inv.InventoryApp)
×
622
                }
×
623
        }
624

625
        return r0
×
626
}
627

628
// WithLimits provides a mock function with given fields: attributes, tags
629
func (_m *InventoryApp) WithLimits(attributes int, tags int) inv.InventoryApp {
×
630
        ret := _m.Called(attributes, tags)
×
631

×
NEW
632
        if len(ret) == 0 {
×
NEW
633
                panic("no return value specified for WithLimits")
×
634
        }
635

636
        var r0 inv.InventoryApp
×
637
        if rf, ok := ret.Get(0).(func(int, int) inv.InventoryApp); ok {
×
638
                r0 = rf(attributes, tags)
×
639
        } else {
×
640
                if ret.Get(0) != nil {
×
641
                        r0 = ret.Get(0).(inv.InventoryApp)
×
642
                }
×
643
        }
644

645
        return r0
×
646
}
647

648
// WithReporting provides a mock function with given fields: c
649
func (_m *InventoryApp) WithReporting(c workflows.Client) inv.InventoryApp {
×
650
        ret := _m.Called(c)
×
651

×
NEW
652
        if len(ret) == 0 {
×
NEW
653
                panic("no return value specified for WithReporting")
×
654
        }
655

656
        var r0 inv.InventoryApp
×
657
        if rf, ok := ret.Get(0).(func(workflows.Client) inv.InventoryApp); ok {
×
658
                r0 = rf(c)
×
659
        } else {
×
660
                if ret.Get(0) != nil {
×
661
                        r0 = ret.Get(0).(inv.InventoryApp)
×
662
                }
×
663
        }
664

665
        return r0
×
666
}
667

668
// NewInventoryApp creates a new instance of InventoryApp. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
669
// The first argument is typically a *testing.T value.
670
func NewInventoryApp(t interface {
671
        mock.TestingT
672
        Cleanup(func())
NEW
673
}) *InventoryApp {
×
NEW
674
        mock := &InventoryApp{}
×
NEW
675
        mock.Mock.Test(t)
×
NEW
676

×
NEW
677
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
678

NEW
679
        return mock
×
680
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc