mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
1b8e9b51b2
* Make identity.Requester available at Context * Clean pkg/services/guardian/guardian.go * Clean guardian provider and guardian AC * Clean pkg/api/team.go * Clean ctxhandler, datasources, plugin and live * Clean dashboards and guardian * Implement NewUserDisplayDTOFromRequester * Change status code numbers for http constants * Upgrade signature of ngalert services * log parsing errors instead of throwing error
73 lines
2.0 KiB
Go
73 lines
2.0 KiB
Go
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
|
|
|
package query
|
|
|
|
import (
|
|
context "context"
|
|
|
|
backend "github.com/grafana/grafana-plugin-sdk-go/backend"
|
|
|
|
dtos "github.com/grafana/grafana/pkg/api/dtos"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
identity "github.com/grafana/grafana/pkg/services/auth/identity"
|
|
)
|
|
|
|
// FakeQueryService is an autogenerated mock type for the Service type
|
|
type FakeQueryService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// QueryData provides a mock function with given fields: ctx, _a1, skipDSCache, reqDTO
|
|
func (_m *FakeQueryService) QueryData(ctx context.Context, _a1 identity.Requester, skipDSCache bool, reqDTO dtos.MetricRequest) (*backend.QueryDataResponse, error) {
|
|
ret := _m.Called(ctx, _a1, skipDSCache, reqDTO)
|
|
|
|
var r0 *backend.QueryDataResponse
|
|
if rf, ok := ret.Get(0).(func(context.Context, identity.Requester, bool, dtos.MetricRequest) *backend.QueryDataResponse); ok {
|
|
r0 = rf(ctx, _a1, skipDSCache, reqDTO)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*backend.QueryDataResponse)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, identity.Requester, bool, dtos.MetricRequest) error); ok {
|
|
r1 = rf(ctx, _a1, skipDSCache, reqDTO)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Run provides a mock function with given fields: ctx
|
|
func (_m *FakeQueryService) Run(ctx context.Context) error {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewFakeQueryService interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewFakeQueryService creates a new instance of FakeQueryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewFakeQueryService(t mockConstructorTestingTNewFakeQueryService) *FakeQueryService {
|
|
mock := &FakeQueryService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|