• 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

75.76
/backend/services/deployments/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
        model "github.com/mendersoftware/mender-server/services/deployments/model"
23
        mock "github.com/stretchr/testify/mock"
24

25
        workflows "github.com/mendersoftware/mender-server/services/deployments/client/workflows"
26
)
27

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

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

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

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

48
        return r0
1✔
49
}
50

51
// StartGenerateArtifact provides a mock function with given fields: ctx, multipartGenerateImageMsg
52
func (_m *Client) StartGenerateArtifact(ctx context.Context, multipartGenerateImageMsg *model.MultipartGenerateImageMsg) error {
1✔
53
        ret := _m.Called(ctx, multipartGenerateImageMsg)
1✔
54

1✔
55
        if len(ret) == 0 {
1✔
NEW
56
                panic("no return value specified for StartGenerateArtifact")
×
57
        }
58

59
        var r0 error
1✔
60
        if rf, ok := ret.Get(0).(func(context.Context, *model.MultipartGenerateImageMsg) error); ok {
1✔
61
                r0 = rf(ctx, multipartGenerateImageMsg)
×
62
        } else {
1✔
63
                r0 = ret.Error(0)
1✔
64
        }
1✔
65

66
        return r0
1✔
67
}
68

69
// StartReindexReporting provides a mock function with given fields: c, device
70
func (_m *Client) StartReindexReporting(c context.Context, device string) error {
1✔
71
        ret := _m.Called(c, device)
1✔
72

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

77
        var r0 error
1✔
78
        if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
1✔
79
                r0 = rf(c, device)
×
80
        } else {
1✔
81
                r0 = ret.Error(0)
1✔
82
        }
1✔
83

84
        return r0
1✔
85
}
86

87
// StartReindexReportingDeployment provides a mock function with given fields: c, device, deployment, id
88
func (_m *Client) StartReindexReportingDeployment(c context.Context, device string, deployment string, id string) error {
1✔
89
        ret := _m.Called(c, device, deployment, id)
1✔
90

1✔
91
        if len(ret) == 0 {
1✔
NEW
92
                panic("no return value specified for StartReindexReportingDeployment")
×
93
        }
94

95
        var r0 error
1✔
96
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
1✔
97
                r0 = rf(c, device, deployment, id)
×
98
        } else {
1✔
99
                r0 = ret.Error(0)
1✔
100
        }
1✔
101

102
        return r0
1✔
103
}
104

105
// StartReindexReportingDeploymentBatch provides a mock function with given fields: c, info
106
func (_m *Client) StartReindexReportingDeploymentBatch(c context.Context, info []workflows.DeviceDeploymentShortInfo) error {
1✔
107
        ret := _m.Called(c, info)
1✔
108

1✔
109
        if len(ret) == 0 {
1✔
NEW
110
                panic("no return value specified for StartReindexReportingDeploymentBatch")
×
111
        }
112

113
        var r0 error
1✔
114
        if rf, ok := ret.Get(0).(func(context.Context, []workflows.DeviceDeploymentShortInfo) error); ok {
1✔
115
                r0 = rf(c, info)
×
116
        } else {
1✔
117
                r0 = ret.Error(0)
1✔
118
        }
1✔
119

120
        return r0
1✔
121
}
122

123
// 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.
124
// The first argument is typically a *testing.T value.
125
func NewClient(t interface {
126
        mock.TestingT
127
        Cleanup(func())
NEW
128
}) *Client {
×
UNCOV
129
        mock := &Client{}
×
130
        mock.Mock.Test(t)
×
131

×
132
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
133

134
        return mock
×
135
}
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