fix(tests): update reporting handlers tests to match new signature

NewReportingHandlers now requires a MultiTenantMonitor parameter.
Pass nil since the tests don't need the monitor functionality.
This commit is contained in:
rcourtman 2026-02-03 17:48:44 +00:00
parent d716bbfdeb
commit 2e4e7b06a8

View file

@ -28,7 +28,7 @@ func (s *stubReportingEngine) Generate(req reporting.MetricReportRequest) ([]byt
}
func TestReportingHandlers_MethodNotAllowed(t *testing.T) {
handler := NewReportingHandlers()
handler := NewReportingHandlers(nil)
req := httptest.NewRequest(http.MethodPost, "/api/reporting", nil)
rr := httptest.NewRecorder()
@ -44,7 +44,7 @@ func TestReportingHandlers_EngineUnavailable(t *testing.T) {
reporting.SetEngine(nil)
t.Cleanup(func() { reporting.SetEngine(original) })
handler := NewReportingHandlers()
handler := NewReportingHandlers(nil)
req := httptest.NewRequest(http.MethodGet, "/api/reporting?resourceType=node&resourceId=1", nil)
rr := httptest.NewRecorder()
@ -69,7 +69,7 @@ func TestReportingHandlers_InvalidFormatAndParams(t *testing.T) {
reporting.SetEngine(engine)
t.Cleanup(func() { reporting.SetEngine(original) })
handler := NewReportingHandlers()
handler := NewReportingHandlers(nil)
req := httptest.NewRequest(http.MethodGet, "/api/reporting?format=txt&resourceType=node&resourceId=1", nil)
rr := httptest.NewRecorder()
@ -92,7 +92,7 @@ func TestReportingHandlers_GenerateReport(t *testing.T) {
reporting.SetEngine(engine)
t.Cleanup(func() { reporting.SetEngine(original) })
handler := NewReportingHandlers()
handler := NewReportingHandlers(nil)
start := time.Now().Add(-2 * time.Hour).UTC().Format(time.RFC3339)
end := time.Now().UTC().Format(time.RFC3339)