@@ -57,11 +57,11 @@ import (
57
57
)
58
58
59
59
func TestNewRequestSetsAccept (t * testing.T ) {
60
- r := NewRequest (nil , "get" , & url.URL {Path : "/path/" }, "" , ContentConfig {}, Serializers {}, nil , nil )
60
+ r := NewRequest (nil , "get" , & url.URL {Path : "/path/" }, "" , ContentConfig {}, Serializers {}, nil , nil , 0 )
61
61
if r .headers .Get ("Accept" ) != "" {
62
62
t .Errorf ("unexpected headers: %#v" , r .headers )
63
63
}
64
- r = NewRequest (nil , "get" , & url.URL {Path : "/path/" }, "" , ContentConfig {ContentType : "application/other" }, Serializers {}, nil , nil )
64
+ r = NewRequest (nil , "get" , & url.URL {Path : "/path/" }, "" , ContentConfig {ContentType : "application/other" }, Serializers {}, nil , nil , 0 )
65
65
if r .headers .Get ("Accept" ) != "application/other, */*" {
66
66
t .Errorf ("unexpected headers: %#v" , r .headers )
67
67
}
@@ -86,7 +86,7 @@ func TestRequestSetsHeaders(t *testing.T) {
86
86
config := defaultContentConfig ()
87
87
config .ContentType = "application/other"
88
88
serializers := defaultSerializers (t )
89
- r := NewRequest (server , "get" , & url.URL {Path : "/path" }, "" , config , serializers , nil , nil )
89
+ r := NewRequest (server , "get" , & url.URL {Path : "/path" }, "" , config , serializers , nil , nil , 0 )
90
90
91
91
// Check if all "issue" methods are setting headers.
92
92
_ = r .Do ()
@@ -341,7 +341,7 @@ func TestResultIntoWithNoBodyReturnsErr(t *testing.T) {
341
341
342
342
func TestURLTemplate (t * testing.T ) {
343
343
uri , _ := url .Parse ("http://localhost" )
344
- r := NewRequest (nil , "POST" , uri , "" , ContentConfig {GroupVersion : & schema.GroupVersion {Group : "test" }}, Serializers {}, nil , nil )
344
+ r := NewRequest (nil , "POST" , uri , "" , ContentConfig {GroupVersion : & schema.GroupVersion {Group : "test" }}, Serializers {}, nil , nil , 0 )
345
345
r .Prefix ("pre1" ).Resource ("r1" ).Namespace ("ns" ).Name ("nm" ).Param ("p0" , "v0" )
346
346
full := r .URL ()
347
347
if full .String () != "http://localhost/pre1/namespaces/ns/r1/nm?p0=v0" {
@@ -403,7 +403,7 @@ func TestTransformResponse(t *testing.T) {
403
403
{Response : & http.Response {StatusCode : 200 , Body : ioutil .NopCloser (bytes .NewReader (invalid ))}, Data : invalid },
404
404
}
405
405
for i , test := range testCases {
406
- r := NewRequest (nil , "" , uri , "" , defaultContentConfig (), defaultSerializers (t ), nil , nil )
406
+ r := NewRequest (nil , "" , uri , "" , defaultContentConfig (), defaultSerializers (t ), nil , nil , 0 )
407
407
if test .Response .Body == nil {
408
408
test .Response .Body = ioutil .NopCloser (bytes .NewReader ([]byte {}))
409
409
}
@@ -554,7 +554,7 @@ func TestTransformResponseNegotiate(t *testing.T) {
554
554
serializers .RenegotiatedDecoder = negotiator .invoke
555
555
contentConfig := defaultContentConfig ()
556
556
contentConfig .ContentType = test .ContentType
557
- r := NewRequest (nil , "" , uri , "" , contentConfig , serializers , nil , nil )
557
+ r := NewRequest (nil , "" , uri , "" , contentConfig , serializers , nil , nil , 0 )
558
558
if test .Response .Body == nil {
559
559
test .Response .Body = ioutil .NopCloser (bytes .NewReader ([]byte {}))
560
560
}
@@ -1480,7 +1480,7 @@ func TestAbsPath(t *testing.T) {
1480
1480
{"/p1/api/p2" , "/api/r1" , "/api/" , "/p1/api/p2/api/" },
1481
1481
} {
1482
1482
u , _ := url .Parse ("http://localhost:123" + tc .configPrefix )
1483
- r := NewRequest (nil , "POST" , u , "" , ContentConfig {GroupVersion : & schema.GroupVersion {Group : "test" }}, Serializers {}, nil , nil ).Prefix (tc .resourcePrefix ).AbsPath (tc .absPath )
1483
+ r := NewRequest (nil , "POST" , u , "" , ContentConfig {GroupVersion : & schema.GroupVersion {Group : "test" }}, Serializers {}, nil , nil , 0 ).Prefix (tc .resourcePrefix ).AbsPath (tc .absPath )
1484
1484
if r .pathPrefix != tc .wantsAbsPath {
1485
1485
t .Errorf ("test case %d failed, unexpected path: %q, expected %q" , i , r .pathPrefix , tc .wantsAbsPath )
1486
1486
}
0 commit comments