From d71043609e46d1999939038eb24dad3139743ff7 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 2 Jul 2019 09:42:35 +0200 Subject: [PATCH] Testing: Include BatchRevoke for all tokens in the fake. (#17728) --- pkg/services/auth/testing.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/services/auth/testing.go b/pkg/services/auth/testing.go index 378a68b053c..4a31f3d9840 100644 --- a/pkg/services/auth/testing.go +++ b/pkg/services/auth/testing.go @@ -15,6 +15,7 @@ type FakeUserAuthTokenService struct { ActiveAuthTokenCount func(ctx context.Context) (int64, error) GetUserTokenProvider func(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error) GetUserTokensProvider func(ctx context.Context, userId int64) ([]*models.UserToken, error) + BatchRevokedTokenProvider func(ctx context.Context, userIds []int64) error } func NewFakeUserAuthTokenService() *FakeUserAuthTokenService { @@ -40,6 +41,9 @@ func NewFakeUserAuthTokenService() *FakeUserAuthTokenService { RevokeAllUserTokensProvider: func(ctx context.Context, userId int64) error { return nil }, + BatchRevokedTokenProvider: func(ctx context.Context, userIds []int64) error { + return nil + }, ActiveAuthTokenCount: func(ctx context.Context) (int64, error) { return 10, nil }, @@ -83,3 +87,7 @@ func (s *FakeUserAuthTokenService) GetUserToken(ctx context.Context, userId, use func (s *FakeUserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error) { return s.GetUserTokensProvider(context.Background(), userId) } + +func (s *FakeUserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error { + return s.BatchRevokedTokenProvider(ctx, userIds) +}