github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/command/agent/stats_endpoint_test.go (about) 1 package agent 2 3 import ( 4 "net/http" 5 "net/http/httptest" 6 "testing" 7 ) 8 9 func TestClientStatsRequest(t *testing.T) { 10 t.Parallel() 11 httpTest(t, nil, func(s *TestAgent) { 12 req, err := http.NewRequest("GET", "/v1/client/stats/?since=foo", nil) 13 if err != nil { 14 t.Fatalf("err: %v", err) 15 } 16 17 respW := httptest.NewRecorder() 18 _, err = s.Server.ClientStatsRequest(respW, req) 19 if err != nil { 20 t.Fatalf("unexpected err: %v", err) 21 } 22 }) 23 }