zrhoffman commented on code in PR #7608:
URL: https://github.com/apache/trafficcontrol/pull/7608#discussion_r1253518794
##########
traffic_monitor/cache/cache_test.go:
##########
@@ -95,3 +100,36 @@ func TestComputeStatGbps(t *testing.T) {
}
}
}
+
+func TestParseAndDecode(t *testing.T) {
+ file, err := ioutil.ReadFile("stats_over_http.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ pl := &poller.HTTPPollCtx{HTTPHeader: http.Header{}}
+ ctx := interface{}(pl)
+ ctx.(*poller.HTTPPollCtx).HTTPHeader.Set("Content-Type",
rfc.ApplicationJSON)
Review Comment:
That said, hard-coding constants in tests is good because it catches
regressions if the library constants are ever changed. Though this is
@ocket8888's suggestion, so up to them if leaving it hard-coded is okay
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]