File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -360,16 +360,16 @@ func TestNegotiateAPIVersionConnectionFailure(t *testing.T) {
360
360
361
361
func TestNegotiateAPIVersionAutomatic (t * testing.T ) {
362
362
var pingVersion string
363
- httpClient := newMockClient (func (req * http.Request ) (* http.Response , error ) {
364
- resp := & http.Response {StatusCode : http .StatusOK , Header : http.Header {}}
365
- resp .Header .Set ("Api-Version" , pingVersion )
366
- resp .Body = io .NopCloser (strings .NewReader ("OK" ))
367
- return resp , nil
368
- })
369
363
370
364
ctx := context .Background ()
371
365
client , err := NewClientWithOpts (
372
- WithHTTPClient (httpClient ),
366
+ WithHTTPClient (& http.Client {
367
+ Transport : roundTripFunc (func (req * http.Request ) (* http.Response , error ) {
368
+ resp := & http.Response {StatusCode : http .StatusOK , Header : http.Header {}}
369
+ resp .Header .Set ("Api-Version" , pingVersion )
370
+ resp .Body = io .NopCloser (strings .NewReader ("OK" ))
371
+ return resp , nil
372
+ })}),
373
373
WithAPIVersionNegotiation (),
374
374
)
375
375
assert .NilError (t , err )
You can’t perform that action at this time.
0 commit comments