(t *testing.T)
| 304 | } |
| 305 | |
| 306 | func TestClientRequest(t *testing.T) { |
| 307 | body := strings.NewReader("Hello, world!") |
| 308 | url := "https://example.com:8888/foo/bar?stuff=morestuff" |
| 309 | req := httptest.NewRequest("pOST", url, body) |
| 310 | req.Header.Set("User-Agent", "go-test-agent") |
| 311 | |
| 312 | want := []attribute.KeyValue{ |
| 313 | attribute.String("http.request.method", "POST"), |
| 314 | attribute.String("http.request.method_original", "pOST"), |
| 315 | attribute.String("url.full", url), |
| 316 | attribute.String("server.address", "example.com"), |
| 317 | attribute.Int("server.port", 8888), |
| 318 | attribute.String("network.protocol.version", "1.1"), |
| 319 | } |
| 320 | got := semconv.HTTPClient{}.RequestTraceAttrs(req) |
| 321 | assert.ElementsMatch(t, want, got) |
| 322 | } |
| 323 | |
| 324 | func TestClientResponse(t *testing.T) { |
| 325 | testcases := []struct { |
nothing calls this directly
no test coverage detected