Chore: Remove bus (#47511) (#47677)

* Chore: Remove bus

* remove unused const

(cherry picked from commit 18e93c7077)
This commit is contained in:
Serge Zaitsev
2022-04-13 11:51:21 +02:00
committed by GitHub
parent 691e94ebe4
commit 7729b14da3
53 changed files with 19 additions and 701 deletions
@@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/contexthandler"
"github.com/grafana/grafana/pkg/setting"
@@ -109,14 +108,6 @@ func TestMiddlewareJWTAuth(t *testing.T) {
}, nil
}
sc.mockSQLStore.ExpectedSignedInUser = &models.SignedInUser{UserId: id, OrgId: orgID, Email: myEmail}
bus.AddHandler("upsert-user", func(ctx context.Context, command *models.UpsertUserCommand) error {
command.Result = &models.User{
Id: id,
Name: command.ExternalUser.Name,
Email: command.ExternalUser.Email,
}
return nil
})
sc.fakeReq("GET", "/").withJWTAuthHeader(token).exec()
assert.Equal(t, verifiedToken, token)