(req *http.Request)
| 24 | } |
| 25 | |
| 26 | func (s *stubRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { |
| 27 | s.lastReq = req |
| 28 | if req.Body != nil { |
| 29 | data, _ := io.ReadAll(req.Body) |
| 30 | s.lastBody = string(data) |
| 31 | } |
| 32 | status := s.status |
| 33 | if status == 0 { |
| 34 | status = http.StatusOK |
| 35 | } |
| 36 | return &http.Response{ |
| 37 | StatusCode: status, |
| 38 | Header: http.Header{"Content-Type": {"application/x-www-form-urlencoded; charset=utf-8"}}, |
| 39 | Body: io.NopCloser(strings.NewReader(s.body)), |
| 40 | Request: req, |
| 41 | }, nil |
| 42 | } |
| 43 | |
| 44 | func TestTokenRefresherRefresh(t *testing.T) { |
| 45 | // Pin a non-UTC clock so the test proves the derived expiry is normalized to UTC rather than inheriting the |
nothing calls this directly
no outgoing calls
no test coverage detected