mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 06:12:20 +08:00
Replace AddHandler with AddHandlerCtx in tests (#42585)
This commit is contained in:
@ -24,12 +24,12 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
influxDBDs := &models.DataSource{Id: 16, OrgId: 1, Name: "InfluxDB", Uid: "InfluxDB-uid"}
|
||||
prom := &models.DataSource{Id: 17, OrgId: 1, Name: "Prometheus", Uid: "Prometheus-uid"}
|
||||
|
||||
bus.AddHandler("test", func(query *models.GetDefaultDataSourceQuery) error {
|
||||
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetDefaultDataSourceQuery) error {
|
||||
query.Result = defaultDs
|
||||
return nil
|
||||
})
|
||||
|
||||
bus.AddHandler("test", func(query *models.GetDataSourceQuery) error {
|
||||
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetDataSourceQuery) error {
|
||||
if query.Name == defaultDs.Name || query.Uid == defaultDs.Uid {
|
||||
query.Result = defaultDs
|
||||
}
|
||||
|
Reference in New Issue
Block a user