-
Notifications
You must be signed in to change notification settings - Fork 70
/
action_test.go
36 lines (27 loc) · 683 Bytes
/
action_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package zabbix
import (
"testing"
)
func TestActions(t *testing.T) {
session := GetTestSession(t)
params := ActionGetParams{}
actions, err := session.GetActions(params)
if err != nil {
t.Fatalf("Error getting actions: %v", err)
}
if len(actions) == 0 {
t.Fatal("No actions found")
}
for i, action := range actions {
if action.ActionID == "" {
t.Fatalf("Action %d has no Action ID", i)
}
if action.Name == "" {
t.Fatalf("Action %d has no name", i)
}
if action.EventType == EventSourceTrigger && action.ProblemMessageSubject == "" {
t.Fatalf("Action %d has no problem message subject", i)
}
}
t.Logf("Validated %d Actions", len(actions))
}