• 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

33.33
/backend/services/deviceconnect/client/workflows/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
        workflows "github.com/mendersoftware/mender-server/services/deviceconnect/client/workflows"
23
        mock "github.com/stretchr/testify/mock"
24
)
25

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

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

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

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

46
        return r0
×
47
}
48

49
// SubmitAuditLog provides a mock function with given fields: ctx, log
50
func (_m *Client) SubmitAuditLog(ctx context.Context, log workflows.AuditLog) error {
1✔
51
        ret := _m.Called(ctx, log)
1✔
52

1✔
53
        if len(ret) == 0 {
1✔
NEW
54
                panic("no return value specified for SubmitAuditLog")
×
55
        }
56

57
        var r0 error
1✔
58
        if rf, ok := ret.Get(0).(func(context.Context, workflows.AuditLog) error); ok {
1✔
59
                r0 = rf(ctx, log)
×
60
        } else {
1✔
61
                r0 = ret.Error(0)
1✔
62
        }
1✔
63

64
        return r0
1✔
65
}
66

67
// 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.
68
// The first argument is typically a *testing.T value.
69
func NewClient(t interface {
70
        mock.TestingT
71
        Cleanup(func())
NEW
72
}) *Client {
×
NEW
73
        mock := &Client{}
×
NEW
74
        mock.Mock.Test(t)
×
NEW
75

×
NEW
76
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
77

NEW
78
        return mock
×
79
}
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