MCPcopy
hub / github.com/kopia/kopia / TestWebhook_Failure

Function TestWebhook_Failure

notification/sender/webhook/webhook_sender_test.go:104–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func 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
117func TestWebhook_InvalidURL(t *testing.T) {
118 ctx := testlogging.Context(t)

Callers

nothing calls this directly

Calls 3

ContextFunction · 0.92
GetSenderFunction · 0.92
SendMethod · 0.65

Tested by

no test coverage detected