2022-04-21 14:48:21 +00:00
|
|
|
// Code generated by mockery v2.11.0. DO NOT EDIT.
|
2022-04-05 14:26:14 +00:00
|
|
|
|
|
|
|
package connectca
|
|
|
|
|
|
|
|
import (
|
2022-04-05 21:10:06 +00:00
|
|
|
acl "github.com/hashicorp/consul/acl"
|
2022-04-14 13:26:14 +00:00
|
|
|
mock "github.com/stretchr/testify/mock"
|
2022-04-21 14:48:21 +00:00
|
|
|
|
|
|
|
testing "testing"
|
2022-04-05 14:26:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// MockACLResolver is an autogenerated mock type for the ACLResolver type
|
|
|
|
type MockACLResolver struct {
|
|
|
|
mock.Mock
|
|
|
|
}
|
|
|
|
|
2022-04-14 13:26:14 +00:00
|
|
|
// ResolveTokenAndDefaultMeta provides a mock function with given fields: token, entMeta, authzContext
|
|
|
|
func (_m *MockACLResolver) ResolveTokenAndDefaultMeta(token string, entMeta *acl.EnterpriseMeta, authzContext *acl.AuthorizerContext) (acl.Authorizer, error) {
|
|
|
|
ret := _m.Called(token, entMeta, authzContext)
|
2022-04-05 14:26:14 +00:00
|
|
|
|
|
|
|
var r0 acl.Authorizer
|
2022-04-05 21:10:06 +00:00
|
|
|
if rf, ok := ret.Get(0).(func(string, *acl.EnterpriseMeta, *acl.AuthorizerContext) acl.Authorizer); ok {
|
2022-04-14 13:26:14 +00:00
|
|
|
r0 = rf(token, entMeta, authzContext)
|
2022-04-05 14:26:14 +00:00
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).(acl.Authorizer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
2022-04-05 21:10:06 +00:00
|
|
|
if rf, ok := ret.Get(1).(func(string, *acl.EnterpriseMeta, *acl.AuthorizerContext) error); ok {
|
2022-04-14 13:26:14 +00:00
|
|
|
r1 = rf(token, entMeta, authzContext)
|
2022-04-05 14:26:14 +00:00
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
2022-04-21 14:48:21 +00:00
|
|
|
|
|
|
|
// NewMockACLResolver creates a new instance of MockACLResolver. It also registers a cleanup function to assert the mocks expectations.
|
|
|
|
func NewMockACLResolver(t testing.TB) *MockACLResolver {
|
|
|
|
mock := &MockACLResolver{}
|
|
|
|
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
|
|
|
|
return mock
|
|
|
|
}
|