mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Return data in camelCase from the OAuth fb strategy * changes * wip * Add defaults for oauth fb strategy * revert other changes * basic includeDefaults query param implementation * basic secret removal and etag implementation * correct imports * rebase * move default settings filter to models * only replace ClientSecret value if set * first GetForProvider test & use FNV for ETag to avoid Blocklisted import error * add tests * add annotation for the openapi spec & generate spec * remove TODO * use IsSecret, improve tests, remove DefaultOAuthSettings * add comment explaining generateFNVETag * add error handling for generateFNVETag * run go generate * Update pkg/services/ssosettings/api/api.go Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com> * move isSecret to service, create GetForProviderWithRedactedSecrets func * add unit test for GetForProviderWithRedactedSecrets & remove duplicated code * regen openapi/swagger * revert dependency bumps --------- Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com> Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
66 lines
1.6 KiB
Go
66 lines
1.6 KiB
Go
// Code generated by mockery v2.38.0. DO NOT EDIT.
|
|
|
|
package ssosettingstests
|
|
|
|
import (
|
|
context "context"
|
|
|
|
models "github.com/grafana/grafana/pkg/services/ssosettings/models"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockReloadable is an autogenerated mock type for the Reloadable type
|
|
type MockReloadable struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Reload provides a mock function with given fields: ctx, settings
|
|
func (_m *MockReloadable) Reload(ctx context.Context, settings models.SSOSettings) error {
|
|
ret := _m.Called(ctx, settings)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Reload")
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Validate provides a mock function with given fields: ctx, settings
|
|
func (_m *MockReloadable) Validate(ctx context.Context, settings models.SSOSettings) error {
|
|
ret := _m.Called(ctx, settings)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Validate")
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// NewMockReloadable creates a new instance of MockReloadable. 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 NewMockReloadable(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockReloadable {
|
|
mock := &MockReloadable{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|