Improve tests for alerting providers
This commit is contained in:
parent
9649d80388
commit
50435f4030
@ -62,7 +62,7 @@ func TestAlertProvider_ToCustomAlertProvider(t *testing.T) {
|
|||||||
provider := AlertProvider{URL: "http://example.com"}
|
provider := AlertProvider{URL: "http://example.com"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if customAlertProvider != customAlertProvider {
|
if customAlertProvider != customAlertProvider {
|
||||||
t.Error("customAlertProvider should've been equal to customAlertProvider")
|
t.Error("customAlertProvider should've been equal to customAlertProvider")
|
||||||
|
@ -38,7 +38,7 @@ func (provider *AlertProvider) ToCustomAlertProvider(service *core.Service, aler
|
|||||||
} else {
|
} else {
|
||||||
prefix = ":x:"
|
prefix = ":x:"
|
||||||
}
|
}
|
||||||
results += fmt.Sprintf("%s - `%s`\n", prefix, conditionResult.Condition)
|
results += fmt.Sprintf("%s - `%s`\\n", prefix, conditionResult.Condition)
|
||||||
}
|
}
|
||||||
return &custom.AlertProvider{
|
return &custom.AlertProvider{
|
||||||
URL: provider.WebhookURL,
|
URL: provider.WebhookURL,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mattermost
|
package mattermost
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -22,20 +24,42 @@ func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
|||||||
provider := AlertProvider{WebhookURL: "http://example.com"}
|
provider := AlertProvider{WebhookURL: "http://example.com"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "SUCCESSFUL_CONDITION", Success: true}}}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "SUCCESSFUL_CONDITION", Success: true}}}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "resolved") {
|
if !strings.Contains(customAlertProvider.Body, "resolved") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring resolved")
|
t.Error("customAlertProvider.Body should've contained the substring resolved")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "http://example.com" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "http://example.com", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
||||||
provider := AlertProvider{WebhookURL: "http://example.com"}
|
provider := AlertProvider{WebhookURL: "http://example.com"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "UNSUCCESSFUL_CONDITION", Success: false}}}, false)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "UNSUCCESSFUL_CONDITION", Success: false}}}, false)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "triggered") {
|
if !strings.Contains(customAlertProvider.Body, "triggered") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring triggered")
|
t.Error("customAlertProvider.Body should've contained the substring triggered")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "http://example.com" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "http://example.com", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package messagebird
|
package messagebird
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -30,11 +32,22 @@ func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
|||||||
}
|
}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://rest.messagebird.com/messages" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://rest.messagebird.com/messages", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
||||||
@ -45,9 +58,20 @@ func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
|||||||
}
|
}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, false)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, false)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://rest.messagebird.com/messages" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://rest.messagebird.com/messages", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package pagerduty
|
package pagerduty
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -22,20 +24,42 @@ func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
|||||||
provider := AlertProvider{IntegrationKey: "00000000000000000000000000000000"}
|
provider := AlertProvider{IntegrationKey: "00000000000000000000000000000000"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://events.pagerduty.com/v2/enqueue" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://events.pagerduty.com/v2/enqueue", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
||||||
provider := AlertProvider{IntegrationKey: "00000000000000000000000000000000"}
|
provider := AlertProvider{IntegrationKey: "00000000000000000000000000000000"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, false)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, false)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://events.pagerduty.com/v2/enqueue" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://events.pagerduty.com/v2/enqueue", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func (provider *AlertProvider) ToCustomAlertProvider(service *core.Service, aler
|
|||||||
} else {
|
} else {
|
||||||
prefix = ":x:"
|
prefix = ":x:"
|
||||||
}
|
}
|
||||||
results += fmt.Sprintf("%s - `%s`\n", prefix, conditionResult.Condition)
|
results += fmt.Sprintf("%s - `%s`\\n", prefix, conditionResult.Condition)
|
||||||
}
|
}
|
||||||
return &custom.AlertProvider{
|
return &custom.AlertProvider{
|
||||||
URL: provider.WebhookURL,
|
URL: provider.WebhookURL,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package slack
|
package slack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -22,20 +24,42 @@ func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
|||||||
provider := AlertProvider{WebhookURL: "http://example.com"}
|
provider := AlertProvider{WebhookURL: "http://example.com"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "SUCCESSFUL_CONDITION", Success: true}}}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "SUCCESSFUL_CONDITION", Success: true}}}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "resolved") {
|
if !strings.Contains(customAlertProvider.Body, "resolved") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring resolved")
|
t.Error("customAlertProvider.Body should've contained the substring resolved")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "http://example.com" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "http://example.com", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
||||||
provider := AlertProvider{WebhookURL: "http://example.com"}
|
provider := AlertProvider{WebhookURL: "http://example.com"}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "UNSUCCESSFUL_CONDITION", Success: false}}}, false)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{ConditionResults: []*core.ConditionResult{{Condition: "UNSUCCESSFUL_CONDITION", Success: false}}}, false)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "triggered") {
|
if !strings.Contains(customAlertProvider.Body, "triggered") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring triggered")
|
t.Error("customAlertProvider.Body should've contained the substring triggered")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "http://example.com" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "http://example.com", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
body := make(map[string]interface{})
|
||||||
|
err := json.Unmarshal([]byte(customAlertProvider.Body), &body)
|
||||||
|
if err != nil {
|
||||||
|
t.Error("expected body to be valid JSON, got error:", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package twilio
|
package twilio
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -26,31 +27,49 @@ func TestTwilioAlertProvider_IsValid(t *testing.T) {
|
|||||||
func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithResolvedAlert(t *testing.T) {
|
||||||
provider := AlertProvider{
|
provider := AlertProvider{
|
||||||
SID: "1",
|
SID: "1",
|
||||||
Token: "1",
|
Token: "2",
|
||||||
From: "1",
|
From: "3",
|
||||||
To: "1",
|
To: "4",
|
||||||
}
|
}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{Name: "service-name"}, &core.Alert{Description: "alert-description"}, &core.Result{}, true)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
if !strings.Contains(customAlertProvider.Body, "RESOLVED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
t.Error("customAlertProvider.Body should've contained the substring RESOLVED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://api.twilio.com/2010-04-01/Accounts/1/Messages.json" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://api.twilio.com/2010-04-01/Accounts/1/Messages.json", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Body != "Body=RESOLVED%3A+service-name+-+alert-description&From=3&To=4" {
|
||||||
|
t.Errorf("expected body to be %s, got %s", "Body=RESOLVED%3A+service-name+-+alert-description&From=3&To=4", customAlertProvider.Body)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
func TestAlertProvider_ToCustomAlertProviderWithTriggeredAlert(t *testing.T) {
|
||||||
provider := AlertProvider{
|
provider := AlertProvider{
|
||||||
SID: "1",
|
SID: "4",
|
||||||
Token: "1",
|
Token: "3",
|
||||||
From: "1",
|
From: "2",
|
||||||
To: "1",
|
To: "1",
|
||||||
}
|
}
|
||||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, false)
|
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{Name: "service-name"}, &core.Alert{Description: "alert-description"}, &core.Result{}, false)
|
||||||
if customAlertProvider == nil {
|
if customAlertProvider == nil {
|
||||||
t.Error("customAlertProvider shouldn't have been nil")
|
t.Fatal("customAlertProvider shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
if !strings.Contains(customAlertProvider.Body, "TRIGGERED") {
|
||||||
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
t.Error("customAlertProvider.Body should've contained the substring TRIGGERED")
|
||||||
}
|
}
|
||||||
|
if customAlertProvider.URL != "https://api.twilio.com/2010-04-01/Accounts/4/Messages.json" {
|
||||||
|
t.Errorf("expected URL to be %s, got %s", "https://api.twilio.com/2010-04-01/Accounts/4/Messages.json", customAlertProvider.URL)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Method != http.MethodPost {
|
||||||
|
t.Errorf("expected method to be %s, got %s", http.MethodPost, customAlertProvider.Method)
|
||||||
|
}
|
||||||
|
if customAlertProvider.Body != "Body=TRIGGERED%3A+service-name+-+alert-description&From=2&To=1" {
|
||||||
|
t.Errorf("expected body to be %s, got %s", "Body=TRIGGERED%3A+service-name+-+alert-description&From=2&To=1", customAlertProvider.Body)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user