mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
3bc13e2335
Adds Public tag to dashboard title when it has an enabled public dashboard
164 lines
4.5 KiB
Go
164 lines
4.5 KiB
Go
// Code generated by mockery v2.12.1. DO NOT EDIT.
|
|
|
|
package publicdashboards
|
|
|
|
import (
|
|
context "context"
|
|
|
|
models "github.com/grafana/grafana/pkg/services/publicdashboards/models"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
pkgmodels "github.com/grafana/grafana/pkg/models"
|
|
|
|
testing "testing"
|
|
)
|
|
|
|
// FakePublicDashboardStore is an autogenerated mock type for the Store type
|
|
type FakePublicDashboardStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// GenerateNewPublicDashboardUid provides a mock function with given fields: ctx
|
|
func (_m *FakePublicDashboardStore) GenerateNewPublicDashboardUid(ctx context.Context) (string, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func(context.Context) string); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetPublicDashboard provides a mock function with given fields: ctx, accessToken
|
|
func (_m *FakePublicDashboardStore) GetPublicDashboard(ctx context.Context, accessToken string) (*models.PublicDashboard, *pkgmodels.Dashboard, error) {
|
|
ret := _m.Called(ctx, accessToken)
|
|
|
|
var r0 *models.PublicDashboard
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *models.PublicDashboard); ok {
|
|
r0 = rf(ctx, accessToken)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*models.PublicDashboard)
|
|
}
|
|
}
|
|
|
|
var r1 *pkgmodels.Dashboard
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) *pkgmodels.Dashboard); ok {
|
|
r1 = rf(ctx, accessToken)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*pkgmodels.Dashboard)
|
|
}
|
|
}
|
|
|
|
var r2 error
|
|
if rf, ok := ret.Get(2).(func(context.Context, string) error); ok {
|
|
r2 = rf(ctx, accessToken)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GetPublicDashboardConfig provides a mock function with given fields: ctx, orgId, dashboardUid
|
|
func (_m *FakePublicDashboardStore) GetPublicDashboardConfig(ctx context.Context, orgId int64, dashboardUid string) (*models.PublicDashboard, error) {
|
|
ret := _m.Called(ctx, orgId, dashboardUid)
|
|
|
|
var r0 *models.PublicDashboard
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, string) *models.PublicDashboard); ok {
|
|
r0 = rf(ctx, orgId, dashboardUid)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*models.PublicDashboard)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
|
|
r1 = rf(ctx, orgId, dashboardUid)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PublicDashboardEnabled provides a mock function with given fields: ctx, dashboardUid
|
|
func (_m *FakePublicDashboardStore) PublicDashboardEnabled(ctx context.Context, dashboardUid string) (bool, error) {
|
|
ret := _m.Called(ctx, dashboardUid)
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok {
|
|
r0 = rf(ctx, dashboardUid)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, dashboardUid)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SavePublicDashboardConfig provides a mock function with given fields: ctx, cmd
|
|
func (_m *FakePublicDashboardStore) SavePublicDashboardConfig(ctx context.Context, cmd models.SavePublicDashboardConfigCommand) (*models.PublicDashboard, error) {
|
|
ret := _m.Called(ctx, cmd)
|
|
|
|
var r0 *models.PublicDashboard
|
|
if rf, ok := ret.Get(0).(func(context.Context, models.SavePublicDashboardConfigCommand) *models.PublicDashboard); ok {
|
|
r0 = rf(ctx, cmd)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*models.PublicDashboard)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, models.SavePublicDashboardConfigCommand) error); ok {
|
|
r1 = rf(ctx, cmd)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdatePublicDashboardConfig provides a mock function with given fields: ctx, cmd
|
|
func (_m *FakePublicDashboardStore) UpdatePublicDashboardConfig(ctx context.Context, cmd models.SavePublicDashboardConfigCommand) error {
|
|
ret := _m.Called(ctx, cmd)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, models.SavePublicDashboardConfigCommand) error); ok {
|
|
r0 = rf(ctx, cmd)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewFakePublicDashboardStore creates a new instance of FakePublicDashboardStore. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewFakePublicDashboardStore(t testing.TB) *FakePublicDashboardStore {
|
|
mock := &FakePublicDashboardStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|