forked from instana/go-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent_internal_test.go
34 lines (28 loc) · 958 Bytes
/
event_internal_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
// (c) Copyright IBM Corp. 2021
// (c) Copyright Instana Inc. 2017
package instana
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestEventBasic(t *testing.T) {
assert.Equal(t, severity(-1), SeverityChange, "SeverityChange wrong value...")
assert.Equal(t, severity(5), SeverityWarning, "SeverityWarning wrong value...")
assert.Equal(t, severity(10), SeverityCritical, "SeverityCritical wrong value...")
}
func TestEventDefault(t *testing.T) {
SendDefaultServiceEvent("microservice-14c", "These are event details",
SeverityCritical, 5000*time.Millisecond)
defer ShutdownSensor()
}
func TestSendServiceEvent(t *testing.T) {
SendServiceEvent("microservice-14c", "Oh No!", "Pull the cable now!",
SeverityChange, 1000*time.Millisecond)
defer ShutdownSensor()
}
func TestSendHostEvent(t *testing.T) {
SendHostEvent("microservice-14c", "r u listening?",
SeverityWarning, 500*time.Millisecond)
defer ShutdownSensor()
}