@@ -15,7 +15,7 @@ type Test struct {
15
15
Key string
16
16
}
17
17
18
- func testHandlerJson (w http.ResponseWriter , r * http.Request ) {
18
+ func testHandlerJSON (w http.ResponseWriter , r * http.Request ) {
19
19
cookie , err := r .Cookie ("cookiename" )
20
20
if err != nil || cookie .Value != "value" {
21
21
httptools .ServerErrorResponse (w , r , err )
@@ -41,8 +41,8 @@ func TestRequestTesterJson(t *testing.T) {
41
41
}
42
42
43
43
tReq := test .CreateRequestTester (
44
- http .HandlerFunc (testHandlerJson ),
45
- test .JsonContentType ,
44
+ http .HandlerFunc (testHandlerJSON ),
45
+ test .JSONContentType ,
46
46
http .MethodPost ,
47
47
"/test/%d" ,
48
48
1 ,
@@ -110,9 +110,15 @@ func TestRequestTesterTestServer(t *testing.T) {
110
110
Key : "data" ,
111
111
}
112
112
113
- ts := httptest .NewServer (http .HandlerFunc (testHandlerJson ))
113
+ ts := httptest .NewServer (http .HandlerFunc (testHandlerJSON ))
114
114
115
- tReq := test .CreateRequestTester (nil , test .JsonContentType , http .MethodGet , "/test/%d" , 1 )
115
+ tReq := test .CreateRequestTester (
116
+ nil ,
117
+ test .JSONContentType ,
118
+ http .MethodGet ,
119
+ "/test/%d" ,
120
+ 1 ,
121
+ )
116
122
tReq .AddCookie (& http.Cookie {Name : "cookiename" , Value : "value" })
117
123
tReq .SetData (reqData )
118
124
tReq .SetTestServer (ts )
@@ -128,7 +134,7 @@ func TestRequestTesterTestServer(t *testing.T) {
128
134
}
129
135
130
136
func TestRequestTesterNoTestServerOrHandler (t * testing.T ) {
131
- tReq := test .CreateRequestTester (nil , test .JsonContentType , http .MethodGet , "" )
137
+ tReq := test .CreateRequestTester (nil , test .JSONContentType , http .MethodGet , "" )
132
138
133
139
assert .PanicsWithValue (
134
140
t ,
0 commit comments