dapper_test.go 474 B

1234567891011121314151617181920212223
  1. package service
  2. import (
  3. "net/http"
  4. "net/http/httptest"
  5. "testing"
  6. )
  7. func TestDapperProxy(t *testing.T) {
  8. dp, err := newDapperProxy("http://172.16.38.143:6193")
  9. if err != nil {
  10. t.Fatal(err)
  11. }
  12. req, err := http.NewRequest(http.MethodGet, "http://example.com/x/admin/apm/dapper/familys", nil)
  13. if err != nil {
  14. t.Fatal(err)
  15. }
  16. resp := httptest.NewRecorder()
  17. dp.ServeHTTP(resp, req)
  18. if resp.Code != http.StatusOK {
  19. t.Errorf("proxy dapper error: %+v", resp)
  20. }
  21. }