Chore: use org service methods (#55768)

* Chore: use org service methods

* fix tests

* fix errors

* adjust func signatures for getbyname

* 💩

* Use the same fake service to get the user in AC and in HS

* Fix middleware test

* Fix more middleware test

* Fix api tests

Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
This commit is contained in:
Kat Yang
2022-10-04 14:48:02 -04:00
committed by GitHub
co-authored by gamab Ida Furjesova
parent 169f1ab974
commit 7715672fb3
14 changed files with 108 additions and 67 deletions
+2
View File
@@ -12,6 +12,7 @@ import (
"github.com/grafana/grafana/pkg/services/auth"
"github.com/grafana/grafana/pkg/services/contexthandler"
"github.com/grafana/grafana/pkg/services/login/loginservice"
"github.com/grafana/grafana/pkg/services/org/orgtest"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/mockstore"
"github.com/grafana/grafana/pkg/services/user/usertest"
@@ -43,6 +44,7 @@ type scenarioContext struct {
loginService *loginservice.LoginServiceMock
apiKeyService *apikeytest.Service
userService *usertest.FakeUserService
orgService *orgtest.FakeOrgService
req *http.Request
}