/
security_voter.go
83 lines (66 loc) · 2.64 KB
/
security_voter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
import (
voter "flamingo.me/flamingo/v3/core/security/application/voter"
mock "github.com/stretchr/testify/mock"
)
// SecurityVoter is an autogenerated mock type for the SecurityVoter type
type SecurityVoter struct {
mock.Mock
}
type SecurityVoter_Expecter struct {
mock *mock.Mock
}
func (_m *SecurityVoter) EXPECT() *SecurityVoter_Expecter {
return &SecurityVoter_Expecter{mock: &_m.Mock}
}
// Vote provides a mock function with given fields: allAssignedPermissions, desiredPermission, forObject
func (_m *SecurityVoter) Vote(allAssignedPermissions []string, desiredPermission string, forObject interface{}) voter.AccessDecision {
ret := _m.Called(allAssignedPermissions, desiredPermission, forObject)
if len(ret) == 0 {
panic("no return value specified for Vote")
}
var r0 voter.AccessDecision
if rf, ok := ret.Get(0).(func([]string, string, interface{}) voter.AccessDecision); ok {
r0 = rf(allAssignedPermissions, desiredPermission, forObject)
} else {
r0 = ret.Get(0).(voter.AccessDecision)
}
return r0
}
// SecurityVoter_Vote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Vote'
type SecurityVoter_Vote_Call struct {
*mock.Call
}
// Vote is a helper method to define mock.On call
// - allAssignedPermissions []string
// - desiredPermission string
// - forObject interface{}
func (_e *SecurityVoter_Expecter) Vote(allAssignedPermissions interface{}, desiredPermission interface{}, forObject interface{}) *SecurityVoter_Vote_Call {
return &SecurityVoter_Vote_Call{Call: _e.mock.On("Vote", allAssignedPermissions, desiredPermission, forObject)}
}
func (_c *SecurityVoter_Vote_Call) Run(run func(allAssignedPermissions []string, desiredPermission string, forObject interface{})) *SecurityVoter_Vote_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]string), args[1].(string), args[2].(interface{}))
})
return _c
}
func (_c *SecurityVoter_Vote_Call) Return(_a0 voter.AccessDecision) *SecurityVoter_Vote_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *SecurityVoter_Vote_Call) RunAndReturn(run func([]string, string, interface{}) voter.AccessDecision) *SecurityVoter_Vote_Call {
_c.Call.Return(run)
return _c
}
// NewSecurityVoter creates a new instance of SecurityVoter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewSecurityVoter(t interface {
mock.TestingT
Cleanup(func())
}) *SecurityVoter {
mock := &SecurityVoter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}