2016-05-28 00:01:08 +00:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"net/http/httptest"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestClientStatsRequest(t *testing.T) {
|
2017-07-20 05:42:15 +00:00
|
|
|
t.Parallel()
|
2017-07-20 05:14:36 +00:00
|
|
|
httpTest(t, nil, func(s *TestAgent) {
|
2016-05-28 00:01:08 +00:00
|
|
|
req, err := http.NewRequest("GET", "/v1/client/stats/?since=foo", nil)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
respW := httptest.NewRecorder()
|
|
|
|
_, err = s.Server.ClientStatsRequest(respW, req)
|
2016-06-12 23:48:55 +00:00
|
|
|
if err != nil {
|
2016-05-28 00:01:08 +00:00
|
|
|
t.Fatalf("unexpected err: %v", err)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|