fix: restore storage endpoint for smoke test

This commit is contained in:
ShukeBta
2026-06-11 21:11:05 +08:00
parent 52d75171b2
commit 0e28d07122
3 changed files with 50 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
package handler
import (
"testing"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"github.com/ShukeBta/MediaStationGo/internal/config"
"github.com/ShukeBta/MediaStationGo/internal/service"
)
func TestStorageRouteIsRegistered(t *testing.T) {
gin.SetMode(gin.TestMode)
router := gin.New()
Register(router, &config.Config{
Secrets: config.SecretsConfig{JWTSecret: "test-secret"},
}, zap.NewNop(), &service.Container{Log: zap.NewNop()})
for _, route := range router.Routes() {
if route.Method == "GET" && route.Path == "/api/storage" {
return
}
}
t.Fatal("GET /api/storage route is not registered")
}