@@ -85,7 +85,12 @@ func TestGetFeature(t *testing.T) {
8585 err : nil ,
8686 },
8787 expectedCallCount : 1 ,
88- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
88+ request : httptest .NewRequestWithContext (
89+ t .Context (),
90+ http .MethodGet ,
91+ "/v1/features/feature1" ,
92+ nil ,
93+ ),
8994 expectedGetCalls : []* ExpectedGetCall {
9095 {
9196 Key : `getFeature-{"feature_id":"feature1","Params":{}}` ,
@@ -129,7 +134,12 @@ func TestGetFeature(t *testing.T) {
129134 name : "Success Case - no optional params - use defaults - cached" ,
130135 mockConfig : nil ,
131136 expectedCallCount : 0 ,
132- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
137+ request : httptest .NewRequestWithContext (
138+ t .Context (),
139+ http .MethodGet ,
140+ "/v1/features/feature1" ,
141+ nil ,
142+ ),
133143 expectedGetCalls : []* ExpectedGetCall {
134144 {
135145 Key : `getFeature-{"feature_id":"feature1","Params":{}}` ,
@@ -319,8 +329,13 @@ func TestGetFeature(t *testing.T) {
319329 err : gcpspanner .ErrQueryReturnedNoResults ,
320330 },
321331 expectedCallCount : 1 ,
322- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
323- expectedResponse : testJSONResponse (404 , `{"code":404,"message":"feature id feature1 is not found"}` ),
332+ request : httptest .NewRequestWithContext (
333+ t .Context (),
334+ http .MethodGet ,
335+ "/v1/features/feature1" ,
336+ nil ,
337+ ),
338+ expectedResponse : testJSONResponse (404 , `{"code":404,"message":"feature id feature1 is not found"}` ),
324339 expectedGetCalls : []* ExpectedGetCall {
325340 {
326341 Key : `getFeature-{"feature_id":"feature1","Params":{}}` ,
@@ -340,8 +355,13 @@ func TestGetFeature(t *testing.T) {
340355 err : errTest ,
341356 },
342357 expectedCallCount : 1 ,
343- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
344- expectedResponse : testJSONResponse (500 , `{"code":500,"message":"unable to get feature"}` ),
358+ request : httptest .NewRequestWithContext (
359+ t .Context (),
360+ http .MethodGet ,
361+ "/v1/features/feature1" ,
362+ nil ,
363+ ),
364+ expectedResponse : testJSONResponse (500 , `{"code":500,"message":"unable to get feature"}` ),
345365 expectedGetCalls : []* ExpectedGetCall {
346366 {
347367 Key : `getFeature-{"feature_id":"feature1","Params":{}}` ,
@@ -361,7 +381,12 @@ func TestGetFeature(t *testing.T) {
361381 err : nil ,
362382 },
363383 expectedCallCount : 1 ,
364- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
384+ request : httptest .NewRequestWithContext (
385+ t .Context (),
386+ http .MethodGet ,
387+ "/v1/features/feature1" ,
388+ nil ,
389+ ),
365390 expectedResponse : func () * http.Response {
366391 // nolint:exhaustruct
367392 return & http.Response {
@@ -400,7 +425,12 @@ func TestGetFeature(t *testing.T) {
400425 err : nil ,
401426 },
402427 expectedCallCount : 1 ,
403- request : httptest .NewRequestWithContext (t .Context (), http .MethodGet , "/v1/features/feature1" , nil ),
428+ request : httptest .NewRequestWithContext (
429+ t .Context (),
430+ http .MethodGet ,
431+ "/v1/features/feature1" ,
432+ nil ,
433+ ),
404434 expectedResponse : testJSONResponse (410 , `
405435{"code":410,"message":"feature is split","new_features":[{"id":"other1"},{"id":"other2"}],"type":"split"}` ,
406436 ),
0 commit comments