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
@@ -32,7 +32,7 @@ func TestInitContextWithAuthProxy_CachedInvalidUserID(t *testing.T) {
// XXX: These handlers have to be injected AFTER calling getContextHandler, since the latter
// creates a SQLStore which installs its own handlers.
upsertHandler := func(cmd *models.UpsertUserCommand) error {
upsertHandler := func(ctx context.Context, cmd *models.UpsertUserCommand) error {
require.Equal(t, name, cmd.ExternalUser.Login)
cmd.Result = &models.User{Id: userID}
return nil
@@ -49,7 +49,7 @@ func TestInitContextWithAuthProxy_CachedInvalidUserID(t *testing.T) {
}
return nil
}
bus.AddHandler("", upsertHandler)
bus.AddHandlerCtx("", upsertHandler)
bus.AddHandlerCtx("", getUserHandler)
t.Cleanup(func() {
bus.ClearBusHandlers()