mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Add AuthNSvc reload handling * Working, need to add test * Remove commented out code * Add Reload implementation to connectors * Align and add tests, refactor * Add more tests, linting * Add extra checks + tests to oauth client * Clean up based on reviews * Move config instantiation into newSocialBase * Use specific error
126 lines
2.9 KiB
Go
126 lines
2.9 KiB
Go
// Code generated by mockery v2.40.1. DO NOT EDIT.
|
|
|
|
package ssosettingstests
|
|
|
|
import (
|
|
context "context"
|
|
|
|
models "github.com/grafana/grafana/pkg/services/ssosettings/models"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockStore is an autogenerated mock type for the Store type
|
|
type MockStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: ctx, provider
|
|
func (_m *MockStore) Delete(ctx context.Context, provider string) error {
|
|
ret := _m.Called(ctx, provider)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, provider)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Get provides a mock function with given fields: ctx, provider
|
|
func (_m *MockStore) Get(ctx context.Context, provider string) (*models.SSOSettings, error) {
|
|
ret := _m.Called(ctx, provider)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *models.SSOSettings
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (*models.SSOSettings, error)); ok {
|
|
return rf(ctx, provider)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *models.SSOSettings); ok {
|
|
r0 = rf(ctx, provider)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*models.SSOSettings)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, provider)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// List provides a mock function with given fields: ctx
|
|
func (_m *MockStore) List(ctx context.Context) ([]*models.SSOSettings, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 []*models.SSOSettings
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context) ([]*models.SSOSettings, error)); ok {
|
|
return rf(ctx)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context) []*models.SSOSettings); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*models.SSOSettings)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Upsert provides a mock function with given fields: ctx, settings
|
|
func (_m *MockStore) Upsert(ctx context.Context, settings *models.SSOSettings) error {
|
|
ret := _m.Called(ctx, settings)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Upsert")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *models.SSOSettings) error); ok {
|
|
r0 = rf(ctx, settings)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewMockStore creates a new instance of MockStore. 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 NewMockStore(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockStore {
|
|
mock := &MockStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|