Rename AddHandlerCtx to AddHandler (#43557)

This commit is contained in:
idafurjes
2021-12-28 16:08:07 +01:00
committed by GitHub
parent ec9d6b9ca9
commit 7936c4c522
95 changed files with 417 additions and 417 deletions
+7 -7
View File
@@ -30,7 +30,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET on", "api/users/:id", func(sc *scenarioContext) {
fakeNow := time.Date(2019, 2, 11, 17, 30, 40, 0, time.UTC)
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetUserProfileQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.GetUserProfileQuery) error {
query.Result = models.UserProfileDTO{
Id: int64(1),
Email: "daniel@grafana.com",
@@ -46,7 +46,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
return nil
})
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetAuthInfoQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.GetAuthInfoQuery) error {
query.Result = &models.UserAuth{
AuthModule: models.AuthModuleLDAP,
}
@@ -83,7 +83,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET on", "/api/users/lookup", func(sc *scenarioContext) {
fakeNow := time.Date(2019, 2, 11, 17, 30, 40, 0, time.UTC)
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.GetUserByLoginQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.GetUserByLoginQuery) error {
require.Equal(t, "danlee", query.LoginOrEmail)
query.Result = &models.User{
@@ -130,7 +130,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET on", "/api/users", func(sc *scenarioContext) {
var sentLimit int
var sendPage int
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
query.Result = mockResult
sentLimit = query.Limit
@@ -154,7 +154,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET with page and limit querystring parameters on", "/api/users", func(sc *scenarioContext) {
var sentLimit int
var sendPage int
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
query.Result = mockResult
sentLimit = query.Limit
@@ -174,7 +174,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET on", "/api/users/search", func(sc *scenarioContext) {
var sentLimit int
var sendPage int
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
query.Result = mockResult
sentLimit = query.Limit
@@ -200,7 +200,7 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
loggedInUserScenario(t, "When calling GET with page and perpage querystring parameters on", "/api/users/search", func(sc *scenarioContext) {
var sentLimit int
var sendPage int
bus.AddHandlerCtx("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
bus.AddHandler("test", func(ctx context.Context, query *models.SearchUsersQuery) error {
query.Result = mockResult
sentLimit = query.Limit