Chore: Remove bus.Bus field (#47695)

* Chore: Remove bus.Bus field

* fix integration test
This commit is contained in:
Serge Zaitsev
2022-04-13 15:24:13 +02:00
committed by GitHub
parent 337d5bf423
commit e86b6662a1
38 changed files with 70 additions and 204 deletions

View File

@ -16,7 +16,6 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/usagestats"
"github.com/grafana/grafana/pkg/models"
@ -46,7 +45,7 @@ func TestGetHomeDashboard(t *testing.T) {
cfg.StaticRootPath = "../../public/"
hs := &HTTPServer{
Cfg: cfg, Bus: bus.New(),
Cfg: cfg,
pluginStore: &fakePluginStore{},
SQLStore: mockstore.NewSQLStoreMock(),
}
@ -96,7 +95,7 @@ func newTestLive(t *testing.T, store *sqlstore.SQLStore) *live.GrafanaLive {
nil,
&usagestats.UsageStatsMock{T: t},
nil,
features, nil, accesscontrolmock.New())
features, accesscontrolmock.New())
require.NoError(t, err)
return gLive
}
@ -991,7 +990,6 @@ func postDashboardScenario(t *testing.T, desc string, url string, routePattern s
t.Run(fmt.Sprintf("%s %s", desc, url), func(t *testing.T) {
cfg := setting.NewCfg()
hs := HTTPServer{
Bus: bus.GetBus(),
Cfg: cfg,
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
Live: newTestLive(t, sqlstore.InitTestDB(t)),
@ -1027,7 +1025,6 @@ func postDiffScenario(t *testing.T, desc string, url string, routePattern string
cfg := setting.NewCfg()
hs := HTTPServer{
Cfg: cfg,
Bus: bus.GetBus(),
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
Live: newTestLive(t, sqlstore.InitTestDB(t)),
QuotaService: &quota.QuotaService{Cfg: cfg},
@ -1062,7 +1059,6 @@ func restoreDashboardVersionScenario(t *testing.T, desc string, url string, rout
mockSQLStore := mockstore.NewSQLStoreMock()
hs := HTTPServer{
Cfg: cfg,
Bus: bus.GetBus(),
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
Live: newTestLive(t, sqlstore.InitTestDB(t)),
QuotaService: &quota.QuotaService{Cfg: cfg},