Plugins: Migrate PluginStore mock to pre-existing fakes package (#71664)

* migrate to existing fakes package

* fix imports
This commit is contained in:
Will Browne
2023-07-17 10:21:44 +00:00
committed by GitHub
parent d707377700
commit a8577c21ba
22 changed files with 93 additions and 86 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import (
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/plugins"
pluginFakes "github.com/grafana/grafana/pkg/plugins/manager/fakes"
acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
"github.com/grafana/grafana/pkg/services/datasources"
datasourceservice "github.com/grafana/grafana/pkg/services/datasources/service"
@@ -42,7 +43,7 @@ func TestHandleRequest(t *testing.T) {
dsService, err := datasourceservice.ProvideService(nil, secretsService, secretsStore, sqlStore.Cfg, featuremgmt.WithFeatures(), acmock.New(), datasourcePermissions, quotaService)
require.NoError(t, err)
pCtxProvider := plugincontext.ProvideService(localcache.ProvideService(), &plugins.FakePluginStore{
pCtxProvider := plugincontext.ProvideService(localcache.ProvideService(), &pluginFakes.FakePluginStore{
PluginList: []plugins.PluginDTO{{JSONData: plugins.JSONData{ID: "test"}}},
}, dsService, pluginSettings.ProvideService(sqlStore, secretsService))
s := ProvideService(client, nil, dsService, pCtxProvider)