@@ -24,25 +24,25 @@ import (
24
24
)
25
25
26
26
func TestHTTPErrorResponseWithDelete (t * testing.T ) {
27
- testHTTPErrorResponse (t , "DELETE" , contentType , "" , http .StatusMethodNotAllowed )
27
+ testHTTPErrorResponse (t , http . MethodDelete , contentType , "" , http .StatusMethodNotAllowed )
28
28
}
29
29
30
30
func TestHTTPErrorResponseWithPut (t * testing.T ) {
31
- testHTTPErrorResponse (t , "PUT" , contentType , "" , http .StatusMethodNotAllowed )
31
+ testHTTPErrorResponse (t , http . MethodPut , contentType , "" , http .StatusMethodNotAllowed )
32
32
}
33
33
34
34
func TestHTTPErrorResponseWithMaxContentLength (t * testing.T ) {
35
35
body := make ([]rune , maxHTTPRequestContentLength + 1 )
36
36
testHTTPErrorResponse (t ,
37
- "POST" , contentType , string (body ), http .StatusRequestEntityTooLarge )
37
+ http . MethodPost , contentType , string (body ), http .StatusRequestEntityTooLarge )
38
38
}
39
39
40
40
func TestHTTPErrorResponseWithEmptyContentType (t * testing.T ) {
41
- testHTTPErrorResponse (t , "POST" , "" , "" , http .StatusUnsupportedMediaType )
41
+ testHTTPErrorResponse (t , http . MethodPost , "" , "" , http .StatusUnsupportedMediaType )
42
42
}
43
43
44
44
func TestHTTPErrorResponseWithValidRequest (t * testing.T ) {
45
- testHTTPErrorResponse (t , "POST" , contentType , "" , 0 )
45
+ testHTTPErrorResponse (t , http . MethodPost , contentType , "" , 0 )
46
46
}
47
47
48
48
func testHTTPErrorResponse (t * testing.T , method , contentType , body string , expected int ) {
0 commit comments