INNER CODE UNIT · Go
recordedRequest
cloudflare/alertmanager2es · main_test.go:104
func recordedRequest(t *testing.T, url string) (*httptest.ResponseRecorder, *http.Request) {
w := httptest.NewRecorder()
r, err := http.NewRequest("POST", url, bytes.NewBuffer(amNotification))
if err != nil {
t.Fatal(err)
}
return w, r
}
var amNotification = []byte(`{
"alerts": [
{
"annotations": {
"link": "https://example.com/Foo+Bar",
"summary": "Alert summary"
},
"endsAt": "0001-01-01T00:00:00Z",