52 lines
1.4 KiB
Go
52 lines
1.4 KiB
Go
package webhook
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func TestEmailWebhookHandler_HandleEmailWebhook_Cov10(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
h := &EmailWebhookHandler{}
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(http.MethodPost, "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.HandleEmailWebhook(c)
|
|
}
|
|
|
|
func TestTwilioWebhookHandler_HandleTwilioCallback_Cov10(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
h := &TwilioWebhookHandler{}
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(http.MethodPost, "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.HandleTwilioCallback(c)
|
|
}
|
|
|
|
func TestFacebookWebhookHandler_HandleFacebookWebhook_Cov10(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
h := &FacebookWebhookHandler{}
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(http.MethodGet, "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.HandleFacebookWebhook(c)
|
|
}
|
|
|
|
func TestFacebookWebhookHandler_LookupInstagramInboxForEvent_Cov10(t *testing.T) {
|
|
h := &FacebookWebhookHandler{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = h.lookupInstagramInboxForEvent(nil)
|
|
}
|
|
|
|
func TestIncomingPersister_LoadInboxForStatusJob_Cov10(t *testing.T) {
|
|
p := &IncomingPersister{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = p.loadInboxForStatusJob(nil, 1)
|
|
}
|