mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-30 03:36:37 +08:00
44ca451cd4
优化
28 lines
602 B
Go
28 lines
602 B
Go
package handler
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/ShukeBta/MMTL/internal/config"
|
|
"github.com/ShukeBta/MMTL/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")
|
|
}
|