jsonResponse creates an HTTP response with JSON body.
(body interface{})
| 33 | |
| 34 | // jsonResponse creates an HTTP response with JSON body. |
| 35 | func jsonResponse(body interface{}) *http.Response { |
| 36 | b, _ := json.Marshal(body) |
| 37 | return &http.Response{ |
| 38 | StatusCode: 200, |
| 39 | Header: http.Header{"Content-Type": []string{"application/json"}}, |
| 40 | Body: io.NopCloser(bytes.NewReader(b)), |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // staticTokenResolver always returns a fixed token without any HTTP calls. |
| 45 | type staticTokenResolver struct{} |
no outgoing calls
no test coverage detected