Skip to content

Commit

Permalink
Refactor TestSpanStatus in restful_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Jun 24, 2022
1 parent 400eea2 commit 8b14968
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,11 @@ func TestSpanStatus(t *testing.T) {
resp.WriteHeader(tc.httpStatusCode)
}
ws := &restful.WebService{}
ws.Route(ws.GET("/").To(handlerFunc).
Returns(200, "OK", nil).
Returns(404, "Not Found", nil))
ws.Route(ws.GET("/").To(handlerFunc))
container := restful.NewContainer()
container.Filter(otelrestful.OTelFilter("my-service", otelrestful.WithTracerProvider(provider)))
container.Add(ws)

container.ServeHTTP(httptest.NewRecorder(), httptest.NewRequest("GET", "/", nil))

require.Len(t, sr.Ended(), 1, "should emit a span")
Expand Down

0 comments on commit 8b14968

Please sign in to comment.