2021-08-25 08:11:22 -05:00
|
|
|
package server
|
|
|
|
|
2022-01-26 09:42:40 -06:00
|
|
|
import (
|
2022-12-01 12:08:36 -06:00
|
|
|
"github.com/grafana/grafana/pkg/infra/httpclient"
|
|
|
|
"github.com/grafana/grafana/pkg/plugins/manager/registry"
|
2022-09-29 07:42:01 -05:00
|
|
|
"github.com/grafana/grafana/pkg/services/grpcserver"
|
2022-01-26 09:42:40 -06:00
|
|
|
"github.com/grafana/grafana/pkg/services/notifications"
|
2022-12-01 12:08:36 -06:00
|
|
|
"github.com/grafana/grafana/pkg/services/oauthtoken/oauthtokentest"
|
2022-01-26 09:42:40 -06:00
|
|
|
"github.com/grafana/grafana/pkg/services/sqlstore"
|
|
|
|
)
|
2021-08-25 08:11:22 -05:00
|
|
|
|
2022-12-01 12:08:36 -06:00
|
|
|
func ProvideTestEnv(
|
|
|
|
server *Server,
|
|
|
|
store *sqlstore.SQLStore,
|
|
|
|
ns *notifications.NotificationServiceMock,
|
|
|
|
grpcServer grpcserver.Provider,
|
|
|
|
pluginRegistry registry.Service,
|
|
|
|
httpClientProvider httpclient.Provider,
|
|
|
|
oAuthTokenService *oauthtokentest.Service,
|
|
|
|
) (*TestEnv, error) {
|
|
|
|
return &TestEnv{
|
|
|
|
server,
|
|
|
|
store,
|
|
|
|
ns,
|
|
|
|
grpcServer,
|
|
|
|
pluginRegistry,
|
|
|
|
httpClientProvider,
|
|
|
|
oAuthTokenService,
|
|
|
|
}, nil
|
2021-08-25 08:11:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type TestEnv struct {
|
2022-01-26 09:42:40 -06:00
|
|
|
Server *Server
|
|
|
|
SQLStore *sqlstore.SQLStore
|
|
|
|
NotificationService *notifications.NotificationServiceMock
|
2022-09-29 07:42:01 -05:00
|
|
|
GRPCServer grpcserver.Provider
|
2022-12-01 12:08:36 -06:00
|
|
|
PluginRegistry registry.Service
|
|
|
|
HTTPClientProvider httpclient.Provider
|
|
|
|
OAuthTokenService *oauthtokentest.Service
|
2021-08-25 08:11:22 -05:00
|
|
|
}
|