diff options
Diffstat (limited to 'server_config_test.go')
| -rw-r--r-- | server_config_test.go | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/server_config_test.go b/server_config_test.go index bb30e5c..bd17b5e 100644 --- a/server_config_test.go +++ b/server_config_test.go @@ -16,15 +16,15 @@ func TestServerConfig_init(t *testing.T) { exp ServerConfig } - var webhookURL12000 *url.URL - var webhookURL12001 *url.URL + var remoteURL12000 *url.URL + var remoteURL12001 *url.URL var err error - webhookURL12000, err = url.Parse(`http://127.0.0.1:12000`) + remoteURL12000, err = url.Parse(`http://127.0.0.1:12000`) if err != nil { t.Fatal(err) } - webhookURL12001, err = url.Parse(`http://127.0.0.1:12001`) + remoteURL12001, err = url.Parse(`http://127.0.0.1:12001`) if err != nil { t.Fatal(err) } @@ -39,18 +39,29 @@ func TestServerConfig_init(t *testing.T) { Address: `127.0.0.1:12121`, Notifs: []*NotifConfig{{ Kind: `mattermost`, - WebhookURL: `http://127.0.0.1:12000`, + RemoteURL: `http://127.0.0.1:12000`, Channel: `chan_1`, UpTemplate: `Service {{.ID}} is up again!`, DownTemplate: `Service {{.ID}} is down: {{.Error}}`, - webhookURL: webhookURL12000, + remoteURL: remoteURL12000, }, { Kind: `mattermost`, - WebhookURL: `http://127.0.0.1:12001`, + RemoteURL: `http://127.0.0.1:12001`, Channel: `chan_2`, UpTemplate: `Service {{.ID}} is alive!`, DownTemplate: `Service {{.ID}} is down: {{.Error}}`, - webhookURL: webhookURL12001, + remoteURL: remoteURL12001, + }, { + Kind: `smtp`, + RemoteURL: `smtps://127.0.0.1:4650`, + User: `john.doe@example.local`, + Password: `dummy`, + Recipient: []string{ + `jane@example.local`, + `kent@example.local`, + }, + UpTemplate: `Service {{.ID}} is alive!`, + DownTemplate: `Service {{.ID}} is down: {{.Error}}`, }}, }, }} |
