expiredRefresher returns a mock whose refresh token is rejected by the server, recorded via gh.ErrRefreshTokenInvalid, and records its calls.
()
| 549 | // expiredRefresher returns a mock whose refresh token is rejected by the server, recorded via |
| 550 | // gh.ErrRefreshTokenInvalid, and records its calls. |
| 551 | func expiredRefresher() *ghmock.TokenRefresherMock { |
| 552 | return &ghmock.TokenRefresherMock{ |
| 553 | RefreshFunc: func(_ string, _ string) (gh.RefreshableCredential, error) { |
| 554 | return gh.RefreshableCredential{}, fmt.Errorf("server rejected token: %w", gh.ErrRefreshTokenInvalid) |
| 555 | }, |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | func TestTokenRunRefresh(t *testing.T) { |
| 560 | // past and future are relative to the 10 minute refresh leeway: past tokens (or those with no recorded expiry) |
no test coverage detected