@@ -142,7 +142,7 @@ func TestBuildRequest_BuildHTTP_NoPayload(t *testing.T) {
142142 req , err := r .BuildHTTP (runtime .JSONMime , "" , testProducers , nil )
143143 require .NoError (t , err )
144144 require .NotNil (t , req )
145- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit" ))
145+ assert .Equal (t , "200" , req .Header .Get (strings . ToLower ( "X-Rate-Limit" ) ))
146146 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
147147 assert .Equal (t , "/flats/1234/" , req .URL .Path )
148148}
@@ -162,7 +162,7 @@ func TestBuildRequest_BuildHTTP_Payload(t *testing.T) {
162162 req , err := r .BuildHTTP (runtime .JSONMime , "" , testProducers , nil )
163163 require .NoError (t , err )
164164 require .NotNil (t , req )
165- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit" ))
165+ assert .Equal (t , "200" , req .Header .Get (strings . ToLower ( "X-Rate-Limit" ) ))
166166 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
167167 assert .Equal (t , "/flats/1234/" , req .URL .Path )
168168 expectedBody , err := json .Marshal (bd )
@@ -197,7 +197,7 @@ func TestBuildRequest_BuildHTTP_SetsInAuth(t *testing.T) {
197197 require .NoError (t , err )
198198 require .NotNil (t , req )
199199
200- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
200+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
201201 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
202202 assert .Equal (t , "/flats/1234/" , req .URL .Path )
203203 expectedBody , err := json .Marshal (bd )
@@ -227,7 +227,7 @@ func TestBuildRequest_BuildHTTP_XMLPayload(t *testing.T) {
227227 require .NoError (t , err )
228228 require .NotNil (t , req )
229229
230- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
230+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
231231 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
232232 assert .Equal (t , "/flats/1234/" , req .URL .Path )
233233 expectedBody , err := xml .Marshal (bd )
@@ -254,7 +254,7 @@ func TestBuildRequest_BuildHTTP_TextPayload(t *testing.T) {
254254 require .NoError (t , err )
255255 require .NotNil (t , req )
256256
257- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
257+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
258258 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
259259 assert .Equal (t , "/flats/1234/" , req .URL .Path )
260260 expectedBody := []byte (bd )
@@ -278,7 +278,7 @@ func TestBuildRequest_BuildHTTP_Form(t *testing.T) {
278278 require .NoError (t , err )
279279 require .NotNil (t , req )
280280
281- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
281+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
282282 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
283283 assert .Equal (t , "/flats/1234/" , req .URL .Path )
284284 expected := []byte ("something=some+value" )
@@ -301,7 +301,7 @@ func TestBuildRequest_BuildHTTP_Form_URLEncoded(t *testing.T) {
301301 require .NoError (t , err )
302302 require .NotNil (t , req )
303303
304- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
304+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
305305 assert .Equal (t , runtime .URLencodedFormMime , req .Header .Get (runtime .HeaderContentType ))
306306 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
307307 assert .Equal (t , "/flats/1234/" , req .URL .Path )
@@ -325,7 +325,7 @@ func TestBuildRequest_BuildHTTP_Form_Content_Length(t *testing.T) {
325325 require .NoError (t , err )
326326 require .NotNil (t , req )
327327
328- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
328+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
329329 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
330330 assert .Equal (t , "/flats/1234/" , req .URL .Path )
331331 assert .Condition (t , func () bool { return req .ContentLength > 0 },
@@ -350,7 +350,7 @@ func TestBuildRequest_BuildHTTP_FormMultipart(t *testing.T) {
350350 require .NoError (t , err )
351351 require .NotNil (t , req )
352352
353- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
353+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
354354 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
355355 assert .Equal (t , "/flats/1234/" , req .URL .Path )
356356 expected1 := []byte ("Content-Disposition: form-data; name=\" something\" " )
@@ -383,7 +383,7 @@ func TestBuildRequest_BuildHTTP_FormMultiples(t *testing.T) {
383383 require .NoError (t , err )
384384 require .NotNil (t , req )
385385
386- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
386+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
387387 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
388388 assert .Equal (t , "/flats/1234/" , req .URL .Path )
389389 expected1 := []byte ("Content-Disposition: form-data; name=\" something\" " )
@@ -410,7 +410,7 @@ func TestBuildRequest_BuildHTTP_Files(t *testing.T) {
410410 require .NoError (t , err )
411411 cont2 , err := os .ReadFile ("./request.go" )
412412 require .NoError (t , err )
413- emptyFile , err := os .CreateTemp ("" , "empty" )
413+ emptyFile , err := os .CreateTemp ("" , "empty" ) //nolint:usetesting
414414 require .NoError (t , err )
415415
416416 reqWrtr := runtime .ClientRequestWriterFunc (func (req runtime.ClientRequest , _ strfmt.Registry ) error {
@@ -429,7 +429,7 @@ func TestBuildRequest_BuildHTTP_Files(t *testing.T) {
429429 require .NoError (t , err )
430430 require .NotNil (t , req )
431431
432- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
432+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
433433 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
434434 assert .Equal (t , "/flats/1234/" , req .URL .Path )
435435
@@ -482,7 +482,7 @@ func TestBuildRequest_BuildHTTP_Files_URLEncoded(t *testing.T) {
482482 require .NoError (t , err )
483483 require .NotNil (t , req )
484484
485- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
485+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
486486 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
487487 assert .Equal (t , "/flats/1234/" , req .URL .Path )
488488 mediaType , params , err := mime .ParseMediaType (req .Header .Get (runtime .HeaderContentType ))
@@ -581,7 +581,7 @@ func TestBuildRequest_BuildHTTP_BasePath(t *testing.T) {
581581 req , err := r .BuildHTTP (runtime .JSONMime , "/basepath" , testProducers , nil )
582582 require .NoError (t , err )
583583 require .NotNil (t , req )
584- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
584+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
585585 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
586586 assert .Equal (t , "/basepath/flats/1234/" , req .URL .Path )
587587}
@@ -600,7 +600,7 @@ func TestBuildRequest_BuildHTTP_EscapedPath(t *testing.T) {
600600 require .NoError (t , err )
601601 require .NotNil (t , req )
602602
603- assert .Equal (t , "200" , req .Header .Get ("x-rate-limit " ))
603+ assert .Equal (t , "200" , req .Header .Get ("X-Rate-Limit " ))
604604 assert .Equal (t , "world" , req .URL .Query ().Get ("hello" ))
605605 assert .Equal (t , "/basepath/flats/1234/?*&^%/" , req .URL .Path )
606606 assert .Equal (t , "/basepath/flats/1234%2F%3F%2A&%5E%25/" , req .URL .RawPath )
@@ -693,7 +693,7 @@ func TestGetBodyCallsBeforeRoundTrip(t *testing.T) {
693693 server := httptest .NewServer (http .HandlerFunc (func (rw http.ResponseWriter , _ * http.Request ) {
694694 rw .WriteHeader (http .StatusCreated )
695695 _ , err := rw .Write ([]byte ("test result" ))
696- require .NoError (t , err )
696+ assert .NoError (t , err )
697697 }))
698698 defer server .Close ()
699699 hu , err := url .Parse (server .URL )
0 commit comments