* H-300: wire Captain Skills into Web runtime * H-300: enforce effective model and conservative skill budget * H-300: fix CI gosec step * ci: extend golangci-lint timeout * fix lint findings across backend * fix(push): resolve delivery protocol blockers * test(repository): close SQLite test databases * test(repository): reuse SQLite schema per package * H-307: restore backend Go cache in CI * H-307: prefetch modules before cold lint * H-307: resolve govulncheck security gate * H-307: build lint with patched Go toolchain * H-307: clear remaining security scan findings --------- Co-authored-by: Rogee <rogee@ipao.vip>
53 lines
1.4 KiB
Go
53 lines
1.4 KiB
Go
package webhook
|
|
|
|
import (
|
|
"context"
|
|
"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(context.Background(), 1)
|
|
}
|