• 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

32.65
/backend/services/useradm/jwt/mocks/Handler.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
        jwt "github.com/mendersoftware/mender-server/services/useradm/jwt"
21
        mock "github.com/stretchr/testify/mock"
22
)
23

24
// Handler is an autogenerated mock type for the Handler type
25
type Handler struct {
26
        mock.Mock
27
}
28

29
// FromJWT provides a mock function with given fields: _a0
30
func (_m *Handler) FromJWT(_a0 string) (*jwt.Token, error) {
×
31
        ret := _m.Called(_a0)
×
32

×
NEW
33
        if len(ret) == 0 {
×
NEW
34
                panic("no return value specified for FromJWT")
×
35
        }
36

37
        var r0 *jwt.Token
×
NEW
38
        var r1 error
×
NEW
39
        if rf, ok := ret.Get(0).(func(string) (*jwt.Token, error)); ok {
×
NEW
40
                return rf(_a0)
×
NEW
41
        }
×
42
        if rf, ok := ret.Get(0).(func(string) *jwt.Token); ok {
×
43
                r0 = rf(_a0)
×
44
        } else {
×
45
                if ret.Get(0) != nil {
×
46
                        r0 = ret.Get(0).(*jwt.Token)
×
47
                }
×
48
        }
49

50
        if rf, ok := ret.Get(1).(func(string) error); ok {
×
51
                r1 = rf(_a0)
×
52
        } else {
×
53
                r1 = ret.Error(1)
×
54
        }
×
55

56
        return r0, r1
×
57
}
58

59
// ToJWT provides a mock function with given fields: t
60
func (_m *Handler) ToJWT(t *jwt.Token) (string, error) {
1✔
61
        ret := _m.Called(t)
1✔
62

1✔
63
        if len(ret) == 0 {
1✔
NEW
64
                panic("no return value specified for ToJWT")
×
65
        }
66

67
        var r0 string
1✔
68
        var r1 error
1✔
69
        if rf, ok := ret.Get(0).(func(*jwt.Token) (string, error)); ok {
1✔
NEW
70
                return rf(t)
×
NEW
71
        }
×
72
        if rf, ok := ret.Get(0).(func(*jwt.Token) string); ok {
1✔
73
                r0 = rf(t)
×
74
        } else {
1✔
75
                r0 = ret.Get(0).(string)
1✔
76
        }
1✔
77

78
        if rf, ok := ret.Get(1).(func(*jwt.Token) error); ok {
1✔
UNCOV
79
                r1 = rf(t)
×
80
        } else {
1✔
81
                r1 = ret.Error(1)
1✔
82
        }
1✔
83

84
        return r0, r1
1✔
85
}
86

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

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

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