|
|
@@ -25,6 +25,26 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|
|
So(err, ShouldNotBeNil)
|
|
|
})
|
|
|
|
|
|
+ Convey("auto resolve should default to false", func() {
|
|
|
+ json := `{ "integrationKey": "abcdefgh0123456789" }`
|
|
|
+
|
|
|
+ settingsJSON, _ := simplejson.NewJson([]byte(json))
|
|
|
+ model := &m.AlertNotification{
|
|
|
+ Name: "pagerduty_testing",
|
|
|
+ Type: "pagerduty",
|
|
|
+ Settings: settingsJSON,
|
|
|
+ }
|
|
|
+
|
|
|
+ not, err := NewPagerdutyNotifier(model)
|
|
|
+ pagerdutyNotifier := not.(*PagerdutyNotifier)
|
|
|
+
|
|
|
+ So(err, ShouldBeNil)
|
|
|
+ So(pagerdutyNotifier.Name, ShouldEqual, "pagerduty_testing")
|
|
|
+ So(pagerdutyNotifier.Type, ShouldEqual, "pagerduty")
|
|
|
+ So(pagerdutyNotifier.Key, ShouldEqual, "abcdefgh0123456789")
|
|
|
+ So(pagerdutyNotifier.AutoResolve, ShouldBeFalse)
|
|
|
+ })
|
|
|
+
|
|
|
Convey("settings should trigger incident", func() {
|
|
|
json := `
|
|
|
{
|