diff --git a/handlers_test.go b/handlers_test.go index 1d5d4bca2..c7aa39b3d 100644 --- a/handlers_test.go +++ b/handlers_test.go @@ -24,6 +24,7 @@ import ( "testing" "time" + "github.com/DataDog/datadog-go/statsd" "github.com/gorilla/mux" "github.com/mozilla-services/autograph/database" @@ -254,13 +255,14 @@ func TestLBHeartbeat(t *testing.T) { {http.StatusMethodNotAllowed, `PUT`}, {http.StatusMethodNotAllowed, `HEAD`}, } + stats := &statsd.NoOpClient{} for i, testcase := range TESTCASES { req, err := http.NewRequest(testcase.method, "http://foo.bar/__lbheartbeat__", nil) if err != nil { t.Fatal(err) } w := httptest.NewRecorder() - handleLBHeartbeat(w, req) + handleLBHeartbeat(w, req, stats) if w.Code != testcase.expect { t.Fatalf("test case %d failed with code %d but %d was expected", i, w.Code, testcase.expect) @@ -378,13 +380,14 @@ func TestVersion(t *testing.T) { {http.StatusMethodNotAllowed, `PUT`}, {http.StatusMethodNotAllowed, `HEAD`}, } + stats := &statsd.NoOpClient{} for i, testcase := range TESTCASES { req, err := http.NewRequest(testcase.method, "http://foo.bar/__version__", nil) if err != nil { t.Fatal(err) } w := httptest.NewRecorder() - handleVersion(w, req) + handleVersion(w, req, stats) if w.Code != testcase.expect { t.Fatalf("test case %d failed with code %d but %d was expected", i, w.Code, testcase.expect) @@ -434,6 +437,7 @@ func TestSignerAuthorized(t *testing.T) { }, }, } + for tid, testcase := range TESTCASES { userid := testcase.userid body, err := json.Marshal(testcase.sgs)