+
+ if strings.Contains(r.URL.String(), "active") {
+ w.Header().Add("Content-Type", "application/json")
+ w.WriteHeader(200)
+ // Read alerts from file
+ payload, err := readJSONFromFile("../../testresources/prometheus-alerts.json")
+ if err != nil {
+ t.Error("Failed to send response: ", err)
+ }
+ _, err = w.Write(payload)
+ if err != nil {
+ t.Error("Failed to send response: " + err.Error())
+ }
+ return
+ }
+