Replace AddHandler with AddHandlerCtx in tests (#42585)

This commit is contained in:
idafurjes
2021-12-01 15:43:31 +01:00
committed by GitHub
parent 2e3fd9d659
commit e6123bc3ef
37 changed files with 173 additions and 162 deletions

View File

@@ -348,7 +348,7 @@ func TestLoginPostRedirect(t *testing.T) {
return hs.LoginPost(c)
})
bus.AddHandler("grafana-auth", func(query *models.LoginUserQuery) error {
bus.AddHandlerCtx("grafana-auth", func(ctx context.Context, query *models.LoginUserQuery) error {
query.User = &models.User{
Id: 42,
Email: "",
@@ -685,7 +685,7 @@ func TestLoginPostRunLokingHook(t *testing.T) {
for _, c := range testCases {
t.Run(c.desc, func(t *testing.T) {
bus.AddHandler("grafana-auth", func(query *models.LoginUserQuery) error {
bus.AddHandlerCtx("grafana-auth", func(ctx context.Context, query *models.LoginUserQuery) error {
query.User = c.authUser
query.AuthModule = c.authModule
return c.authErr