feat(adapter): add sub2api platform adapter stack

This commit is contained in:
Your Name
2026-05-06 10:45:51 +08:00
parent e112a81c5f
commit cbbb553e9f
40 changed files with 3932 additions and 15 deletions

View File

@@ -104,6 +104,26 @@ func TestNew_AllowsMemoryModeInTestEnv(t *testing.T) {
}
}
func TestNew_RegistersPlatformWebhookRouteWhenSub2APIEnabled(t *testing.T) {
cfg := minimalHTTPConfig()
cfg.Webhook.Secret = "test-secret"
cfg.PlatformAdapters.Enabled = true
cfg.PlatformAdapters.Sub2API.Enabled = true
cfg.PlatformAdapters.Sub2API.IngressSecret = "sub2api-secret"
app, err := New(cfg, logging.New())
if err != nil {
t.Fatalf("New() failed: %v", err)
}
req := httptest.NewRequest(http.MethodGet, "/api/v1/customer-service/platforms/sub2api/webhook", nil)
rr := httptest.NewRecorder()
app.Server.Handler.ServeHTTP(rr, req)
if rr.Code == http.StatusNotFound {
t.Fatal("platform webhook route returned 404; route should be registered")
}
}
func TestApp_TicketStore(t *testing.T) {
cfg := minimalHTTPConfig()
cfg.Webhook.Secret = "test-secret"