2022-10-04 23:26:34 -04:00
package ntfy
2022-10-09 16:39:51 -04:00
import (
"encoding/json"
2024-10-05 02:23:07 +02:00
"io"
"net/http"
"net/http/httptest"
2022-10-09 16:39:51 -04:00
"testing"
2022-12-06 01:41:09 -05:00
"github.com/TwiN/gatus/v5/alerting/alert"
2024-05-09 22:56:16 -04:00
"github.com/TwiN/gatus/v5/config/endpoint"
2022-10-09 16:39:51 -04:00
)
2022-10-04 23:26:34 -04:00
2024-12-16 20:32:13 -05:00
func TestAlertProvider_Validate ( t * testing . T ) {
2022-10-04 23:26:34 -04:00
scenarios := [] struct {
name string
provider AlertProvider
expected bool
}{
{
name : "valid" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 }},
2022-10-04 23:26:34 -04:00
expected : true ,
},
{
2022-10-09 16:34:08 -04:00
name : "no-url-should-use-default-value" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" , Priority : 1 }},
2022-10-09 16:34:08 -04:00
expected : true ,
2022-10-04 23:26:34 -04:00
},
2023-07-03 05:10:16 +02:00
{
name : "valid-with-token" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" , Priority : 1 , Token : "tk_faketoken" }},
2023-07-03 05:10:16 +02:00
expected : true ,
},
{
name : "invalid-token" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" , Priority : 1 , Token : "xx_faketoken" }},
2023-07-03 05:10:16 +02:00
expected : false ,
},
2022-10-04 23:26:34 -04:00
{
name : "invalid-topic" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "" , Priority : 1 }},
2022-10-04 23:26:34 -04:00
expected : false ,
},
{
name : "invalid-priority-too-high" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 6 }},
2022-10-04 23:26:34 -04:00
expected : false ,
},
{
name : "invalid-priority-too-low" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : - 1 }},
2022-10-04 23:26:34 -04:00
expected : false ,
},
2022-10-09 16:34:08 -04:00
{
name : "no-priority-should-use-default-value" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" }},
2022-10-09 16:34:08 -04:00
expected : true ,
},
2024-11-30 19:09:20 -08:00
{
name : "invalid-override-token" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" }, Overrides : [] Override {{ Group : "g" , Config : Config { Token : "xx_faketoken" }}}},
2024-11-30 19:09:20 -08:00
expected : false ,
},
{
name : "invalid-override-priority" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" }, Overrides : [] Override {{ Group : "g" , Config : Config { Priority : 8 }}}},
2024-11-30 19:09:20 -08:00
expected : false ,
},
{
name : "no-override-group-name" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" }, Overrides : [] Override {{}}},
2024-11-30 19:09:20 -08:00
expected : false ,
},
{
name : "duplicate-override-group-names" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" }, Overrides : [] Override {{ Group : "g" }, { Group : "g" }}},
2024-11-30 19:09:20 -08:00
expected : false ,
},
{
name : "valid-override" ,
2024-12-16 20:32:13 -05:00
provider : AlertProvider { DefaultConfig : Config { Topic : "example" }, Overrides : [] Override {{ Group : "g1" , Config : Config { Priority : 4 , Click : "https://example.com" }}, { Group : "g2" , Config : Config { Topic : "Example" , Token : "tk_faketoken" }}}},
2024-11-30 19:09:20 -08:00
expected : true ,
},
2022-10-04 23:26:34 -04:00
}
for _ , scenario := range scenarios {
t . Run ( scenario . name , func ( t * testing . T ) {
2024-12-16 20:32:13 -05:00
err := scenario . provider . Validate ()
if scenario . expected && err != nil {
t . Error ( "expected no error, got" , err . Error ())
}
if ! scenario . expected && err == nil {
t . Error ( "expected error, got none" )
2022-10-04 23:26:34 -04:00
}
})
}
}
2022-10-09 16:39:51 -04:00
func TestAlertProvider_buildRequestBody ( t * testing . T ) {
firstDescription := "description-1"
secondDescription := "description-2"
scenarios := [] struct {
Name string
Provider AlertProvider
Alert alert . Alert
Resolved bool
ExpectedBody string
}{
{
Name : "triggered" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 }},
2022-10-09 16:39:51 -04:00
Alert : alert . Alert { Description : & firstDescription , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2023-09-30 19:51:03 +08:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1}` ,
2022-10-09 16:39:51 -04:00
},
{
Name : "resolved" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 2 }},
2022-10-09 16:39:51 -04:00
Alert : alert . Alert { Description : & secondDescription , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : true ,
2023-09-30 19:51:03 +08:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been resolved after passing successfully 5 time(s) in a row with the following description: description-2\n🟢 [CONNECTED] == true\n🟢 [STATUS] == 200","tags":["white_check_mark"],"priority":2}` ,
2022-10-09 16:39:51 -04:00
},
2024-10-05 02:23:07 +02:00
{
Name : "triggered-email" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & firstDescription , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
},
{
Name : "resolved-email" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 2 , Email : "test@example.com" , Click : "example.com" }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & secondDescription , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : true ,
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been resolved after passing successfully 5 time(s) in a row with the following description: description-2\n🟢 [CONNECTED] == true\n🟢 [STATUS] == 200","tags":["white_check_mark"],"priority":2,"email":"test@example.com","click":"example.com"}` ,
},
2024-11-30 19:09:20 -08:00
{
2024-12-16 20:32:13 -05:00
Name : "group-override" ,
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 5 , Email : "test@example.com" , Click : "example.com" }, Overrides : [] Override {{ Group : "g" , Config : Config { Topic : "group-topic" , Priority : 4 , Email : "override@test.com" , Click : "test.com" }}}},
2024-11-30 19:09:20 -08:00
Alert : alert . Alert { Description : & firstDescription , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2024-12-16 20:32:13 -05:00
ExpectedBody : `{"topic":"group-topic","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":4,"email":"override@test.com","click":"test.com"}` ,
},
{
Name : "alert-override" ,
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 5 , Email : "test@example.com" , Click : "example.com" }, Overrides : [] Override {{ Group : "g" , Config : Config { Topic : "group-topic" , Priority : 4 , Email : "override@test.com" , Click : "test.com" }}}},
Alert : alert . Alert { Description : & firstDescription , SuccessThreshold : 5 , FailureThreshold : 3 , ProviderOverride : map [ string ] any { "topic" : "alert-topic" }},
Resolved : false ,
ExpectedBody : `{"topic":"alert-topic","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":4,"email":"override@test.com","click":"test.com"}` ,
2024-11-30 19:09:20 -08:00
},
2022-10-09 16:39:51 -04:00
}
for _ , scenario := range scenarios {
t . Run ( scenario . Name , func ( t * testing . T ) {
2024-12-16 20:32:13 -05:00
cfg , err := scenario . Provider . GetConfig ( "g" , & scenario . Alert )
if err != nil {
t . Error ( "expected no error, got" , err . Error ())
}
2022-10-09 16:39:51 -04:00
body := scenario . Provider . buildRequestBody (
2024-12-16 20:32:13 -05:00
cfg ,
2024-05-09 22:56:16 -04:00
& endpoint . Endpoint { Name : "endpoint-name" },
2022-10-09 16:39:51 -04:00
& scenario . Alert ,
2024-05-09 22:56:16 -04:00
& endpoint . Result {
ConditionResults : [] * endpoint . ConditionResult {
2022-10-09 16:39:51 -04:00
{ Condition : "[CONNECTED] == true" , Success : scenario . Resolved },
{ Condition : "[STATUS] == 200" , Success : scenario . Resolved },
},
},
scenario . Resolved ,
)
2022-10-09 22:58:18 -04:00
if string ( body ) != scenario . ExpectedBody {
2022-10-20 17:09:40 -04:00
t . Errorf ( "expected:\n%s\ngot:\n%s" , scenario . ExpectedBody , body )
2022-10-09 16:39:51 -04:00
}
out := make ( map [ string ] interface {})
2022-10-09 22:58:18 -04:00
if err := json . Unmarshal ( body , & out ); err != nil {
2022-10-09 16:39:51 -04:00
t . Error ( "expected body to be valid JSON, got error:" , err . Error ())
}
})
}
}
2024-10-05 02:23:07 +02:00
func TestAlertProvider_Send ( t * testing . T ) {
description := "description-1"
scenarios := [] struct {
Name string
Provider AlertProvider
Alert alert . Alert
Resolved bool
2024-11-30 19:09:20 -08:00
Group string
2024-10-05 02:23:07 +02:00
ExpectedBody string
ExpectedHeaders map [ string ] string
}{
{
Name : "triggered" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2024-11-30 19:09:20 -08:00
Group : "" ,
2024-10-05 02:23:07 +02:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
},
},
2024-11-30 19:09:20 -08:00
{
Name : "token" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" , Token : "tk_mytoken" }},
2024-11-30 19:09:20 -08:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
Group : "" ,
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
"Authorization" : "Bearer tk_mytoken" ,
},
},
2024-10-05 02:23:07 +02:00
{
Name : "no firebase" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" , DisableFirebase : true }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2024-11-30 19:09:20 -08:00
Group : "" ,
2024-10-05 02:23:07 +02:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
"Firebase" : "no" ,
},
},
{
Name : "no cache" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" , DisableCache : true }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2024-11-30 19:09:20 -08:00
Group : "" ,
2024-10-05 02:23:07 +02:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
"Cache" : "no" ,
},
},
{
Name : "neither firebase & cache" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" , DisableFirebase : true , DisableCache : true }},
2024-10-05 02:23:07 +02:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
2024-11-30 19:09:20 -08:00
Group : "" ,
2024-10-05 02:23:07 +02:00
ExpectedBody : `{"topic":"example","title":"Gatus: endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
"Firebase" : "no" ,
"Cache" : "no" ,
},
},
2024-11-30 19:09:20 -08:00
{
Name : "overrides" ,
2024-12-16 20:32:13 -05:00
Provider : AlertProvider { DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 , Email : "test@example.com" , Click : "example.com" , Token : "tk_mytoken" }, Overrides : [] Override { Override { Group : "other-group" , Config : Config { URL : "https://example.com" , Token : "tk_othertoken" }}, Override { Group : "test-group" , Config : Config { Token : "tk_test_token" }}}},
2024-11-30 19:09:20 -08:00
Alert : alert . Alert { Description : & description , SuccessThreshold : 5 , FailureThreshold : 3 },
Resolved : false ,
Group : "test-group" ,
ExpectedBody : `{"topic":"example","title":"Gatus: test-group/endpoint-name","message":"An alert has been triggered due to having failed 3 time(s) in a row with the following description: description-1\n🔴 [CONNECTED] == true\n🔴 [STATUS] == 200","tags":["rotating_light"],"priority":1,"email":"test@example.com","click":"example.com"}` ,
ExpectedHeaders : map [ string ] string {
"Content-Type" : "application/json" ,
"Authorization" : "Bearer tk_test_token" ,
},
},
2024-10-05 02:23:07 +02:00
}
for _ , scenario := range scenarios {
t . Run ( scenario . Name , func ( t * testing . T ) {
// Start a local HTTP server
server := httptest . NewServer ( http . HandlerFunc ( func ( rw http . ResponseWriter , req * http . Request ) {
// Test request parameters
for header , value := range scenario . ExpectedHeaders {
if value != req . Header . Get ( header ) {
t . Errorf ( "expected: %s, got: %s" , value , req . Header . Get ( header ))
}
}
body , _ := io . ReadAll ( req . Body )
if string ( body ) != scenario . ExpectedBody {
t . Errorf ( "expected:\n%s\ngot:\n%s" , scenario . ExpectedBody , body )
}
// Send response to be tested
rw . Write ([] byte ( `OK` ))
}))
// Close the server when test finishes
defer server . Close ()
2024-12-16 20:32:13 -05:00
scenario . Provider . DefaultConfig . URL = server . URL
2024-10-05 02:23:07 +02:00
err := scenario . Provider . Send (
2024-11-30 19:09:20 -08:00
& endpoint . Endpoint { Name : "endpoint-name" , Group : scenario . Group },
2024-10-05 02:23:07 +02:00
& scenario . Alert ,
& endpoint . Result {
ConditionResults : [] * endpoint . ConditionResult {
{ Condition : "[CONNECTED] == true" , Success : scenario . Resolved },
{ Condition : "[STATUS] == 200" , Success : scenario . Resolved },
},
},
scenario . Resolved ,
)
if err != nil {
t . Error ( "Encountered an error on Send: " , err )
}
})
}
2024-12-16 20:32:13 -05:00
}
2024-10-05 02:23:07 +02:00
2024-12-16 20:32:13 -05:00
func TestAlertProvider_GetConfig ( t * testing . T ) {
scenarios := [] struct {
Name string
Provider AlertProvider
InputGroup string
InputAlert alert . Alert
ExpectedOutput Config
}{
{
Name : "provider-no-override-specify-no-group-should-default" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : nil ,
},
InputGroup : "" ,
InputAlert : alert . Alert {},
ExpectedOutput : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
},
{
Name : "provider-no-override-specify-group-should-default" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : nil ,
},
InputGroup : "group" ,
InputAlert : alert . Alert {},
ExpectedOutput : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
},
{
Name : "provider-with-override-specify-no-group-should-default" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : [] Override {
{
Group : "group" ,
Config : Config { URL : "https://group-example.com" , Topic : "group-topic" , Priority : 2 },
},
},
},
InputGroup : "" ,
InputAlert : alert . Alert {},
ExpectedOutput : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
},
{
Name : "provider-with-override-specify-group-should-override" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : [] Override {
{
Group : "group" ,
Config : Config { URL : "https://group-example.com" , Topic : "group-topic" , Priority : 2 },
},
},
},
InputGroup : "group" ,
InputAlert : alert . Alert {},
ExpectedOutput : Config { URL : "https://group-example.com" , Topic : "group-topic" , Priority : 2 },
},
{
Name : "provider-with-group-override-and-alert-override--alert-override-should-take-precedence" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : [] Override {
{
Group : "group" ,
Config : Config { URL : "https://group-example.com" , Topic : "group-topic" , Priority : 2 },
},
},
},
InputGroup : "group" ,
InputAlert : alert . Alert { ProviderOverride : map [ string ] any { "url" : "http://alert-example.com" , "topic" : "alert-topic" , "priority" : 3 }},
ExpectedOutput : Config { URL : "http://alert-example.com" , Topic : "alert-topic" , Priority : 3 },
},
{
Name : "provider-with-partial-overrides" ,
Provider : AlertProvider {
DefaultConfig : Config { URL : "https://ntfy.sh" , Topic : "example" , Priority : 1 },
Overrides : [] Override {
{
Group : "group" ,
Config : Config { Topic : "group-topic" },
},
},
},
InputGroup : "group" ,
InputAlert : alert . Alert { ProviderOverride : map [ string ] any { "priority" : 3 }},
ExpectedOutput : Config { URL : "https://ntfy.sh" , Topic : "group-topic" , Priority : 3 },
},
}
for _ , scenario := range scenarios {
t . Run ( scenario . Name , func ( t * testing . T ) {
got , err := scenario . Provider . GetConfig ( scenario . InputGroup , & scenario . InputAlert )
if err != nil {
t . Fatalf ( "unexpected error: %s" , err )
}
if got . URL != scenario . ExpectedOutput . URL {
t . Errorf ( "expected url %s, got %s" , scenario . ExpectedOutput . URL , got . URL )
}
if got . Topic != scenario . ExpectedOutput . Topic {
t . Errorf ( "expected topic %s, got %s" , scenario . ExpectedOutput . Topic , got . Topic )
}
if got . Priority != scenario . ExpectedOutput . Priority {
t . Errorf ( "expected priority %d, got %d" , scenario . ExpectedOutput . Priority , got . Priority )
}
// Test ValidateOverrides as well, since it really just calls GetConfig
if err = scenario . Provider . ValidateOverrides ( scenario . InputGroup , & scenario . InputAlert ); err != nil {
t . Errorf ( "unexpected error: %s" , err )
}
})
}
2024-10-05 02:23:07 +02:00
}