Skip to content

Commit

Permalink
Basic starter set of Event API tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo committed Jul 18, 2017
1 parent 34fd2e1 commit 5d6260d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions event_internal_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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)
}

func TestSendServiceEvent(t *testing.T) {
SendServiceEvent("microservice-14c", "Oh No!", "Pull the cable now!",
SeverityChange, 1000*time.Millisecond)
}

func TestSendHostEvent(t *testing.T) {
SendHostEvent("microservice-14c", "r u listening?",
SeverityWarning, 500*time.Millisecond)
}

0 comments on commit 5d6260d

Please sign in to comment.