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

mendersoftware / mender-server / 1635240308

21 Jan 2025 01:35PM UTC coverage: 76.574% (+0.002%) from 76.572%
1635240308

push

gitlab-ci

web-flow
Merge pull request #346 from alfrunes/MEN-7939

fix: Use internal URLs for storage backend when generating artifacts

4299 of 6257 branches covered (68.71%)

Branch coverage included in aggregate %.

37 of 57 new or added lines in 5 files covered. (64.91%)

5 existing lines in 2 files now uncovered.

45366 of 58602 relevant lines covered (77.41%)

20.12 hits per line

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

64.47
/backend/services/deployments/storage/mocks/ObjectStorage.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
        io "io"
22

23
        mock "github.com/stretchr/testify/mock"
24

25
        model "github.com/mendersoftware/mender-server/services/deployments/model"
26

27
        storage "github.com/mendersoftware/mender-server/services/deployments/storage"
28

29
        time "time"
30
)
31

32
// ObjectStorage is an autogenerated mock type for the ObjectStorage type
33
type ObjectStorage struct {
34
        mock.Mock
35
}
36

37
// DeleteObject provides a mock function with given fields: ctx, path
38
func (_m *ObjectStorage) DeleteObject(ctx context.Context, path string) error {
1✔
39
        ret := _m.Called(ctx, path)
1✔
40

1✔
41
        if len(ret) == 0 {
1✔
42
                panic("no return value specified for DeleteObject")
×
43
        }
44

45
        var r0 error
1✔
46
        if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
1✔
47
                r0 = rf(ctx, path)
×
48
        } else {
1✔
49
                r0 = ret.Error(0)
1✔
50
        }
1✔
51

52
        return r0
1✔
53
}
54

55
// DeleteRequest provides a mock function with given fields: ctx, path, duration, public
56
func (_m *ObjectStorage) DeleteRequest(ctx context.Context, path string, duration time.Duration, public bool) (*model.Link, error) {
1✔
57
        ret := _m.Called(ctx, path, duration, public)
1✔
58

1✔
59
        if len(ret) == 0 {
1✔
60
                panic("no return value specified for DeleteRequest")
×
61
        }
62

63
        var r0 *model.Link
1✔
64
        var r1 error
1✔
65
        if rf, ok := ret.Get(0).(func(context.Context, string, time.Duration, bool) (*model.Link, error)); ok {
1✔
NEW
66
                return rf(ctx, path, duration, public)
×
UNCOV
67
        }
×
68
        if rf, ok := ret.Get(0).(func(context.Context, string, time.Duration, bool) *model.Link); ok {
1✔
NEW
69
                r0 = rf(ctx, path, duration, public)
×
70
        } else {
1✔
71
                if ret.Get(0) != nil {
2✔
72
                        r0 = ret.Get(0).(*model.Link)
1✔
73
                }
1✔
74
        }
75

76
        if rf, ok := ret.Get(1).(func(context.Context, string, time.Duration, bool) error); ok {
1✔
NEW
77
                r1 = rf(ctx, path, duration, public)
×
78
        } else {
1✔
79
                r1 = ret.Error(1)
1✔
80
        }
1✔
81

82
        return r0, r1
1✔
83
}
84

85
// GetObject provides a mock function with given fields: ctx, path
86
func (_m *ObjectStorage) GetObject(ctx context.Context, path string) (io.ReadCloser, error) {
1✔
87
        ret := _m.Called(ctx, path)
1✔
88

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

93
        var r0 io.ReadCloser
1✔
94
        var r1 error
1✔
95
        if rf, ok := ret.Get(0).(func(context.Context, string) (io.ReadCloser, error)); ok {
1✔
96
                return rf(ctx, path)
×
97
        }
×
98
        if rf, ok := ret.Get(0).(func(context.Context, string) io.ReadCloser); ok {
1✔
99
                r0 = rf(ctx, path)
×
100
        } else {
1✔
101
                if ret.Get(0) != nil {
2✔
102
                        r0 = ret.Get(0).(io.ReadCloser)
1✔
103
                }
1✔
104
        }
105

106
        if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
1✔
107
                r1 = rf(ctx, path)
×
108
        } else {
1✔
109
                r1 = ret.Error(1)
1✔
110
        }
1✔
111

112
        return r0, r1
1✔
113
}
114

115
// GetRequest provides a mock function with given fields: ctx, path, filename, duration, public
116
func (_m *ObjectStorage) GetRequest(ctx context.Context, path string, filename string, duration time.Duration, public bool) (*model.Link, error) {
1✔
117
        ret := _m.Called(ctx, path, filename, duration, public)
1✔
118

1✔
119
        if len(ret) == 0 {
1✔
120
                panic("no return value specified for GetRequest")
×
121
        }
122

123
        var r0 *model.Link
1✔
124
        var r1 error
1✔
125
        if rf, ok := ret.Get(0).(func(context.Context, string, string, time.Duration, bool) (*model.Link, error)); ok {
1✔
NEW
126
                return rf(ctx, path, filename, duration, public)
×
UNCOV
127
        }
×
128
        if rf, ok := ret.Get(0).(func(context.Context, string, string, time.Duration, bool) *model.Link); ok {
1✔
NEW
129
                r0 = rf(ctx, path, filename, duration, public)
×
130
        } else {
1✔
131
                if ret.Get(0) != nil {
2✔
132
                        r0 = ret.Get(0).(*model.Link)
1✔
133
                }
1✔
134
        }
135

136
        if rf, ok := ret.Get(1).(func(context.Context, string, string, time.Duration, bool) error); ok {
1✔
NEW
137
                r1 = rf(ctx, path, filename, duration, public)
×
138
        } else {
1✔
139
                r1 = ret.Error(1)
1✔
140
        }
1✔
141

142
        return r0, r1
1✔
143
}
144

145
// HealthCheck provides a mock function with given fields: ctx
146
func (_m *ObjectStorage) HealthCheck(ctx context.Context) error {
1✔
147
        ret := _m.Called(ctx)
1✔
148

1✔
149
        if len(ret) == 0 {
1✔
150
                panic("no return value specified for HealthCheck")
×
151
        }
152

153
        var r0 error
1✔
154
        if rf, ok := ret.Get(0).(func(context.Context) error); ok {
1✔
155
                r0 = rf(ctx)
×
156
        } else {
1✔
157
                r0 = ret.Error(0)
1✔
158
        }
1✔
159

160
        return r0
1✔
161
}
162

163
// PutObject provides a mock function with given fields: ctx, path, src
164
func (_m *ObjectStorage) PutObject(ctx context.Context, path string, src io.Reader) error {
1✔
165
        ret := _m.Called(ctx, path, src)
1✔
166

1✔
167
        if len(ret) == 0 {
1✔
168
                panic("no return value specified for PutObject")
×
169
        }
170

171
        var r0 error
1✔
172
        if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader) error); ok {
1✔
173
                r0 = rf(ctx, path, src)
×
174
        } else {
1✔
175
                r0 = ret.Error(0)
1✔
176
        }
1✔
177

178
        return r0
1✔
179
}
180

181
// PutRequest provides a mock function with given fields: ctx, path, duration, public
182
func (_m *ObjectStorage) PutRequest(ctx context.Context, path string, duration time.Duration, public bool) (*model.Link, error) {
1✔
183
        ret := _m.Called(ctx, path, duration, public)
1✔
184

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

189
        var r0 *model.Link
1✔
190
        var r1 error
1✔
191
        if rf, ok := ret.Get(0).(func(context.Context, string, time.Duration, bool) (*model.Link, error)); ok {
1✔
NEW
192
                return rf(ctx, path, duration, public)
×
UNCOV
193
        }
×
194
        if rf, ok := ret.Get(0).(func(context.Context, string, time.Duration, bool) *model.Link); ok {
1✔
NEW
195
                r0 = rf(ctx, path, duration, public)
×
196
        } else {
1✔
197
                if ret.Get(0) != nil {
2✔
198
                        r0 = ret.Get(0).(*model.Link)
1✔
199
                }
1✔
200
        }
201

202
        if rf, ok := ret.Get(1).(func(context.Context, string, time.Duration, bool) error); ok {
1✔
NEW
203
                r1 = rf(ctx, path, duration, public)
×
204
        } else {
1✔
205
                r1 = ret.Error(1)
1✔
206
        }
1✔
207

208
        return r0, r1
1✔
209
}
210

211
// StatObject provides a mock function with given fields: ctx, path
212
func (_m *ObjectStorage) StatObject(ctx context.Context, path string) (*storage.ObjectInfo, error) {
×
213
        ret := _m.Called(ctx, path)
×
214

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

219
        var r0 *storage.ObjectInfo
×
220
        var r1 error
×
221
        if rf, ok := ret.Get(0).(func(context.Context, string) (*storage.ObjectInfo, error)); ok {
×
222
                return rf(ctx, path)
×
223
        }
×
224
        if rf, ok := ret.Get(0).(func(context.Context, string) *storage.ObjectInfo); ok {
×
225
                r0 = rf(ctx, path)
×
226
        } else {
×
227
                if ret.Get(0) != nil {
×
228
                        r0 = ret.Get(0).(*storage.ObjectInfo)
×
229
                }
×
230
        }
231

232
        if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
×
233
                r1 = rf(ctx, path)
×
234
        } else {
×
235
                r1 = ret.Error(1)
×
236
        }
×
237

238
        return r0, r1
×
239
}
240

241
// NewObjectStorage creates a new instance of ObjectStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
242
// The first argument is typically a *testing.T value.
243
func NewObjectStorage(t interface {
244
        mock.TestingT
245
        Cleanup(func())
246
}) *ObjectStorage {
×
247
        mock := &ObjectStorage{}
×
248
        mock.Mock.Test(t)
×
249

×
250
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
251

252
        return mock
×
253
}
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