Tests: Add delete user mock field to fake auth info service (#102947)

This commit is contained in:
colin-stuart 2025-03-27 04:45:31 -04:00 committed by GitHub
parent 6822805c32
commit 9ca1d8bca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -14,8 +14,9 @@ type FakeService struct {
ExpectedError error
ExpectedLabels map[int64]string
SetAuthInfoFn func(ctx context.Context, cmd *login.SetAuthInfoCommand) error
UpdateAuthInfoFn func(ctx context.Context, cmd *login.UpdateAuthInfoCommand) error
SetAuthInfoFn func(ctx context.Context, cmd *login.SetAuthInfoCommand) error
UpdateAuthInfoFn func(ctx context.Context, cmd *login.UpdateAuthInfoCommand) error
DeleteUserAuthInfoFn func(ctx context.Context, userID int64) error
}
func (a *FakeService) GetAuthInfo(ctx context.Context, query *login.GetAuthInfoQuery) (*login.UserAuth, error) {
@ -44,5 +45,9 @@ func (a *FakeService) UpdateAuthInfo(ctx context.Context, cmd *login.UpdateAuthI
}
func (a *FakeService) DeleteUserAuthInfo(ctx context.Context, userID int64) error {
if a.DeleteUserAuthInfoFn != nil {
return a.DeleteUserAuthInfoFn(ctx, userID)
}
return a.ExpectedError
}