Skip to content

Commit

Permalink
update pagerduty2 test case for links
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Nov 28, 2018
1 parent f89f2de commit c86e7bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integrations/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9403,6 +9403,8 @@ stream
.pagerDuty2()
.pagerDuty2()
.routingKey('test_override_key')
.link('http://example.com')
.link('http://example.com/{{.TaskName}}','task')
`

var kapacitorURL string
Expand Down Expand Up @@ -9454,6 +9456,10 @@ stream
Timestamp: "1971-01-01T00:00:10.000000000Z",
},
RoutingKey: "test_override_key",
Links: []pagerduty2test.Link{
{Href: "http://example.com", Text: "http://example.com"},
{Href: "http://example.com/TestStream_Alert", Text: "task"},
},
},
},
}
Expand Down
14 changes: 14 additions & 0 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9866,6 +9866,16 @@ func TestServer_AlertHandlers(t *testing.T) {
Kind: "pagerduty2",
Options: map[string]interface{}{
"routing-key": "rkey",
"links": []interface{}{
map[string]string{
"href": "http://example.com",
"text": "t1",
},
map[string]string{
"href": "http://example.com/{{.TaskName}}",
"text": "t2",
},
},
},
},
setup: func(c *server.Config, ha *client.TopicHandler) (context.Context, error) {
Expand Down Expand Up @@ -9909,6 +9919,10 @@ func TestServer_AlertHandlers(t *testing.T) {
Timestamp: "1970-01-01T00:00:00.000000000Z",
},
RoutingKey: "rkey",
Links: []pagerduty2test.Link{
{Href: "http://example.com", Text: "t1"},
{Href: "http://example.com/testAlertHandlers", Text: "t2"},
},
},
}}

Expand Down

0 comments on commit c86e7bf

Please sign in to comment.