fakeRefreshFn returns a refreshFn that updates the connection token to newToken and increments the call counter pointed to by count.
(newToken string, count *int)
| 145 | // fakeRefreshFn returns a refreshFn that updates the connection token to newToken |
| 146 | // and increments the call counter pointed to by count. |
| 147 | func fakeRefreshFn(newToken string, count *int) func(*TokenProvider) errors.Error { |
| 148 | return func(tp *TokenProvider) errors.Error { |
| 149 | *count++ |
| 150 | newExpiry := time.Now().Add(1 * time.Hour) |
| 151 | tp.conn.UpdateToken(newToken, "", &newExpiry, nil) |
| 152 | return nil |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | func TestNeedsRefreshWithRefreshFn(t *testing.T) { |
| 157 | callCount := 0 |
no test coverage detected