From cdb5ba080a5ab6483e424735a92366490e2191d6 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Thu, 18 Feb 2021 23:47:53 -0500 Subject: [PATCH] Minor fix --- alerting/provider/custom/custom_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/alerting/provider/custom/custom_test.go b/alerting/provider/custom/custom_test.go index 4c09b282..92ccd269 100644 --- a/alerting/provider/custom/custom_test.go +++ b/alerting/provider/custom/custom_test.go @@ -71,8 +71,8 @@ func TestAlertProvider_ToCustomAlertProvider(t *testing.T) { func TestAlertProvider_buildHTTPRequestWithCustomPlaceholder(t *testing.T) { const ( - ExpectedURL = "http://example.com/service-name?event=MYTEST&description=alert-description" - ExpectedBody = "service-name,alert-description,MYTEST" + ExpectedURL = "http://example.com/service-name?event=test&description=alert-description" + ExpectedBody = "service-name,alert-description,test" ) customAlertProvider := &AlertProvider{ URL: "http://example.com/[SERVICE_NAME]?event=[ALERT_TRIGGERED_OR_RESOLVED]&description=[ALERT_DESCRIPTION]", @@ -80,7 +80,7 @@ func TestAlertProvider_buildHTTPRequestWithCustomPlaceholder(t *testing.T) { Headers: nil, Placeholders: map[string]map[string]string{ "ALERT_TRIGGERED_OR_RESOLVED": { - "resolved": "MYTEST", + "RESOLVED": "test", }, }, } @@ -101,12 +101,10 @@ func TestAlertProvider_GetAlertStatePlaceholderValueDefaults(t *testing.T) { Headers: nil, Placeholders: nil, } - if customAlertProvider.GetAlertStatePlaceholderValue(true) != "RESOLVED" { - t.Error("expected here actually RESOLVED") + t.Error("expected RESOLVED, got", customAlertProvider.GetAlertStatePlaceholderValue(true)) } - if customAlertProvider.GetAlertStatePlaceholderValue(false) != "TRIGGERED" { - t.Error("expected here actually TRIGGERED") + t.Error("expected TRIGGERED, got", customAlertProvider.GetAlertStatePlaceholderValue(false)) } }