Chore: Add orguser methods to org service interface (#55668)

* Move role types to a separate package

* Make role type singular and remove _ from directory name

* Add orguser methods to org service

* Fix fake method
This commit is contained in:
idafurjes
2022-09-23 07:19:34 -04:00
committed by GitHub
parent 7f98f4b411
commit fb66439c3e
4 changed files with 119 additions and 8 deletions
+12 -8
View File
@@ -3,17 +3,17 @@ package orgtest
import (
"context"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/org"
)
type FakeOrgService struct {
ExpectedOrgUserID int64
ExpectedError error
ExpectedUserOrgDTO []*org.UserOrgDTO
ExpectedOrgs []*org.OrgDTO
ExpectedOrg *org.Org
ExpectedOrgUsers []*org.OrgUserDTO
ExpectedOrgUserID int64
ExpectedError error
ExpectedUserOrgDTO []*org.UserOrgDTO
ExpectedOrgs []*org.OrgDTO
ExpectedOrg *org.Org
ExpectedOrgUsers []*org.OrgUserDTO
ExpectedSearchOrgUsersResult *org.SearchOrgUsersQueryResult
}
func NewOrgServiceFake() *FakeOrgService {
@@ -84,10 +84,14 @@ func (f *FakeOrgService) UpdateOrgUser(ctx context.Context, cmd *org.UpdateOrgUs
return f.ExpectedError
}
func (f *FakeOrgService) GetOrgUsers(ctx context.Context, query *models.GetOrgUsersQuery) ([]*org.OrgUserDTO, error) {
func (f *FakeOrgService) GetOrgUsers(ctx context.Context, query *org.GetOrgUsersQuery) ([]*org.OrgUserDTO, error) {
return f.ExpectedOrgUsers, f.ExpectedError
}
func (f *FakeOrgService) RemoveOrgUser(ctx context.Context, cmd *org.RemoveOrgUserCommand) error {
return f.ExpectedError
}
func (f *FakeOrgService) SearchOrgUsers(ctx context.Context, query *org.SearchOrgUsersQuery) (*org.SearchOrgUsersQueryResult, error) {
return f.ExpectedSearchOrgUsersResult, f.ExpectedError
}