Fix #117: Implement email alerts

This commit is contained in:
TwiN
2021-12-02 21:05:17 -05:00
parent 0331c18401
commit f6336eac4e
53 changed files with 3062 additions and 626 deletions

View File

@ -3,9 +3,6 @@ package custom
import (
"io/ioutil"
"testing"
"github.com/TwiN/gatus/v3/alerting/alert"
"github.com/TwiN/gatus/v3/core"
)
func TestAlertProvider_IsValid(t *testing.T) {
@ -59,17 +56,6 @@ func TestAlertProvider_buildHTTPRequestWhenTriggered(t *testing.T) {
}
}
func TestAlertProvider_ToCustomAlertProvider(t *testing.T) {
provider := AlertProvider{URL: "https://example.com"}
customAlertProvider := provider.ToCustomAlertProvider(&core.Endpoint{}, &alert.Alert{}, &core.Result{}, true)
if customAlertProvider == nil {
t.Fatal("customAlertProvider shouldn't have been nil")
}
if customAlertProvider.URL != "https://example.com" {
t.Error("expected URL to be https://example.com, got", customAlertProvider.URL)
}
}
func TestAlertProvider_buildHTTPRequestWithCustomPlaceholder(t *testing.T) {
const (
ExpectedURL = "https://example.com/endpoint-name?event=test&description=alert-description"