mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 22:24:31 +08:00
Rename AddHandlerCtx to AddHandler (#43557)
This commit is contained in:
@ -29,7 +29,7 @@ func TestPluginProxy(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
bus.AddHandler("test", func(ctx context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
key, err := secretsService.Encrypt(ctx, []byte("123"), secrets.WithoutScope())
|
||||
if err != nil {
|
||||
return err
|
||||
@ -136,7 +136,7 @@ func TestPluginProxy(t *testing.T) {
|
||||
Method: "GET",
|
||||
}
|
||||
|
||||
bus.AddHandlerCtx("test", func(_ context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
bus.AddHandler("test", func(_ context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
query.Result = &models.PluginSetting{
|
||||
JsonData: map[string]interface{}{
|
||||
"dynamicUrl": "https://dynamic.grafana.com",
|
||||
@ -172,7 +172,7 @@ func TestPluginProxy(t *testing.T) {
|
||||
Method: "GET",
|
||||
}
|
||||
|
||||
bus.AddHandlerCtx("test", func(_ context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
bus.AddHandler("test", func(_ context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
query.Result = &models.PluginSetting{}
|
||||
return nil
|
||||
})
|
||||
@ -204,7 +204,7 @@ func TestPluginProxy(t *testing.T) {
|
||||
Body: []byte(`{ "url": "{{.JsonData.dynamicUrl}}", "secret": "{{.SecureJsonData.key}}" }`),
|
||||
}
|
||||
|
||||
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
bus.AddHandler("test", func(ctx context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
encryptedJsonData, err := secretsService.EncryptJsonData(
|
||||
ctx,
|
||||
map[string]string{"key": "123"},
|
||||
|
Reference in New Issue
Block a user