mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
public dashboards: rename api functions (#57789)
This PR imposes better naming conventions on public dashboards api * rename api functions and remove use of _config_ noun * fix tests Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.12.1. DO NOT EDIT.
|
||||
|
||||
package publicdashboards
|
||||
|
||||
@@ -15,6 +15,8 @@ import (
|
||||
|
||||
pkgmodels "github.com/grafana/grafana/pkg/models"
|
||||
|
||||
testing "testing"
|
||||
|
||||
user "github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
|
||||
@@ -297,11 +299,11 @@ func (_m *FakePublicDashboardService) NewPublicDashboardUid(ctx context.Context)
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: ctx, u, dto
|
||||
func (_m *FakePublicDashboardService) Save(ctx context.Context, u *user.SignedInUser, dto *models.SavePublicDashboardConfigDTO) (*models.PublicDashboard, error) {
|
||||
func (_m *FakePublicDashboardService) Save(ctx context.Context, u *user.SignedInUser, dto *models.SavePublicDashboardDTO) (*models.PublicDashboard, error) {
|
||||
ret := _m.Called(ctx, u, dto)
|
||||
|
||||
var r0 *models.PublicDashboard
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *user.SignedInUser, *models.SavePublicDashboardConfigDTO) *models.PublicDashboard); ok {
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *user.SignedInUser, *models.SavePublicDashboardDTO) *models.PublicDashboard); ok {
|
||||
r0 = rf(ctx, u, dto)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -310,7 +312,7 @@ func (_m *FakePublicDashboardService) Save(ctx context.Context, u *user.SignedIn
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *user.SignedInUser, *models.SavePublicDashboardConfigDTO) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *user.SignedInUser, *models.SavePublicDashboardDTO) error); ok {
|
||||
r1 = rf(ctx, u, dto)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -319,13 +321,8 @@ func (_m *FakePublicDashboardService) Save(ctx context.Context, u *user.SignedIn
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewFakePublicDashboardService interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewFakePublicDashboardService creates a new instance of FakePublicDashboardService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewFakePublicDashboardService(t mockConstructorTestingTNewFakePublicDashboardService) *FakePublicDashboardService {
|
||||
// NewFakePublicDashboardService creates a new instance of FakePublicDashboardService. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewFakePublicDashboardService(t testing.TB) *FakePublicDashboardService {
|
||||
mock := &FakePublicDashboardService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user