88 lines
2.2 KiB
Go
88 lines
2.2 KiB
Go
// Code generated by mockery v2.42.1. DO NOT EDIT.
|
|
|
|
package idtest
|
|
|
|
import (
|
|
context "context"
|
|
|
|
authn "github.com/grafana/authlib/authn"
|
|
|
|
identity "github.com/grafana/grafana/pkg/apimachinery/identity"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockService is an autogenerated mock type for the IDService type
|
|
type MockService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// RemoveIDToken provides a mock function with given fields: ctx, _a1
|
|
func (_m *MockService) RemoveIDToken(ctx context.Context, _a1 identity.Requester) error {
|
|
ret := _m.Called(ctx, _a1)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveIDToken")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, identity.Requester) error); ok {
|
|
r0 = rf(ctx, _a1)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SignIdentity provides a mock function with given fields: ctx, id
|
|
func (_m *MockService) SignIdentity(ctx context.Context, id identity.Requester) (string, *authn.Claims[authn.IDTokenClaims], error) {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SignIdentity")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 *authn.Claims[authn.IDTokenClaims]
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, identity.Requester) (string, *authn.Claims[authn.IDTokenClaims], error)); ok {
|
|
return rf(ctx, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, identity.Requester) string); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, identity.Requester) *authn.Claims[authn.IDTokenClaims]); ok {
|
|
r1 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*authn.Claims[authn.IDTokenClaims])
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, identity.Requester) error); ok {
|
|
r2 = rf(ctx, id)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// NewMockService creates a new instance of MockService. 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 NewMockService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockService {
|
|
mock := &MockService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|