• 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

47.62
/backend/services/deviceauth/client/inventory/mocks/Client.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
        mock "github.com/stretchr/testify/mock"
23

24
        model "github.com/mendersoftware/mender-server/services/deviceauth/model"
25
)
26

27
// Client is an autogenerated mock type for the Client type
28
type Client struct {
29
        mock.Mock
30
}
31

32
// CheckHealth provides a mock function with given fields: ctx
33
func (_m *Client) CheckHealth(ctx context.Context) error {
1✔
34
        ret := _m.Called(ctx)
1✔
35

1✔
36
        if len(ret) == 0 {
1✔
NEW
37
                panic("no return value specified for CheckHealth")
×
38
        }
39

40
        var r0 error
1✔
41
        if rf, ok := ret.Get(0).(func(context.Context) error); ok {
1✔
42
                r0 = rf(ctx)
×
43
        } else {
1✔
44
                r0 = ret.Error(0)
1✔
45
        }
1✔
46

47
        return r0
1✔
48
}
49

50
// SetDeviceIdentity provides a mock function with given fields: ctx, tenantId, deviceId, idData
51
func (_m *Client) SetDeviceIdentity(ctx context.Context, tenantId string, deviceId string, idData map[string]interface{}) error {
×
52
        ret := _m.Called(ctx, tenantId, deviceId, idData)
×
53

×
NEW
54
        if len(ret) == 0 {
×
NEW
55
                panic("no return value specified for SetDeviceIdentity")
×
56
        }
57

58
        var r0 error
×
59
        if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]interface{}) error); ok {
×
60
                r0 = rf(ctx, tenantId, deviceId, idData)
×
61
        } else {
×
62
                r0 = ret.Error(0)
×
63
        }
×
64

65
        return r0
×
66
}
67

68
// SetDeviceStatus provides a mock function with given fields: ctx, tenantId, deviceUpdates, status
69
func (_m *Client) SetDeviceStatus(ctx context.Context, tenantId string, deviceUpdates []model.DeviceInventoryUpdate, status string) error {
1✔
70
        ret := _m.Called(ctx, tenantId, deviceUpdates, status)
1✔
71

1✔
72
        if len(ret) == 0 {
1✔
NEW
73
                panic("no return value specified for SetDeviceStatus")
×
74
        }
75

76
        var r0 error
1✔
77
        if rf, ok := ret.Get(0).(func(context.Context, string, []model.DeviceInventoryUpdate, string) error); ok {
1✔
78
                r0 = rf(ctx, tenantId, deviceUpdates, status)
×
79
        } else {
1✔
80
                r0 = ret.Error(0)
1✔
81
        }
1✔
82

83
        return r0
1✔
84
}
85

86
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
87
// The first argument is typically a *testing.T value.
88
func NewClient(t interface {
89
        mock.TestingT
90
        Cleanup(func())
NEW
91
}) *Client {
×
NEW
92
        mock := &Client{}
×
NEW
93
        mock.Mock.Test(t)
×
NEW
94

×
NEW
95
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
96

NEW
97
        return mock
×
98
}
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