Skip to content

Commit

Permalink
webhook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Feb 26, 2019
1 parent 1dc5bbf commit 9f6aaa2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/mediaserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,25 @@ func TestSelectOrchestrator(t *testing.T) {
assert.Equal(expSessionID, sess.PMSessionID)
}

func TestCreateRTMPStreamHandlerWebhook(t *testing.T) {
s := setupServer()
s.RTMPSegmenter = &StubSegmenter{skip: true}
createSid := createRTMPStreamIDHandler(s)
WebhookURL = "http://localhost:8938/notexisting"
u, _ := url.Parse("http://hot/something/?manifestID=id1")
sid := createSid(u)
if sid != "" {
t.Error("Webhook auth failed")
}
WebhookURL = "http://localhost:8938/status"
u, _ = url.Parse("http://hot/something/?manifestID=id2")
sid = createSid(u)
if sid == "" {
t.Error("Webhook auth failed 2")
}
WebhookURL = ""
}

func TestCreateRTMPStreamHandler(t *testing.T) {

// Monkey patch rng to avoid unpredictability even when seeding
Expand Down

0 comments on commit 9f6aaa2

Please sign in to comment.