(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestWebhook_Failure(t *testing.T) { |
| 105 | ctx := testlogging.Context(t) |
| 106 | p, err := sender.GetSender(ctx, "my-profile", "webhook", &webhook.Options{ |
| 107 | Endpoint: "http://localhost:41123/no-such-path", |
| 108 | }) |
| 109 | require.NoError(t, err) |
| 110 | |
| 111 | require.ErrorContains(t, p.Send(ctx, &sender.Message{ |
| 112 | Subject: "Test", |
| 113 | Body: "test", |
| 114 | }), "error sending webhook notification") |
| 115 | } |
| 116 | |
| 117 | func TestWebhook_InvalidURL(t *testing.T) { |
| 118 | ctx := testlogging.Context(t) |