pagerduty: adds test for reading auto resolve setting
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
|||||||
|
|
||||||
func TestPagerdutyNotifier(t *testing.T) {
|
func TestPagerdutyNotifier(t *testing.T) {
|
||||||
Convey("Pagerduty notifier tests", t, func() {
|
Convey("Pagerduty notifier tests", t, func() {
|
||||||
|
|
||||||
Convey("Parsing alert notification from settings", func() {
|
Convey("Parsing alert notification from settings", func() {
|
||||||
Convey("empty settings should return error", func() {
|
Convey("empty settings should return error", func() {
|
||||||
json := `{ }`
|
json := `{ }`
|
||||||
@@ -29,7 +28,8 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
Convey("settings should trigger incident", func() {
|
Convey("settings should trigger incident", func() {
|
||||||
json := `
|
json := `
|
||||||
{
|
{
|
||||||
"integrationKey": "abcdefgh0123456789"
|
"integrationKey": "abcdefgh0123456789",
|
||||||
|
"autoResolve": false
|
||||||
}`
|
}`
|
||||||
|
|
||||||
settingsJSON, _ := simplejson.NewJson([]byte(json))
|
settingsJSON, _ := simplejson.NewJson([]byte(json))
|
||||||
@@ -46,8 +46,8 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
So(pagerdutyNotifier.Name, ShouldEqual, "pagerduty_testing")
|
So(pagerdutyNotifier.Name, ShouldEqual, "pagerduty_testing")
|
||||||
So(pagerdutyNotifier.Type, ShouldEqual, "pagerduty")
|
So(pagerdutyNotifier.Type, ShouldEqual, "pagerduty")
|
||||||
So(pagerdutyNotifier.Key, ShouldEqual, "abcdefgh0123456789")
|
So(pagerdutyNotifier.Key, ShouldEqual, "abcdefgh0123456789")
|
||||||
|
So(pagerdutyNotifier.AutoResolve, ShouldBeFalse)
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user