package handlermanager import ( "testing" "online-back/internal/config" "online-back/internal/identity/rbac" "online-back/pkg/logging" "github.com/gin-gonic/gin" ) // TestRegisterRoutes registers every handler the way New does (no database: // handlers only touch it per request), so a startup panic such as two // groups declaring different policies for one prefix fails here instead // of on the server. func TestRegisterRoutes(t *testing.T) { gin.SetMode(gin.TestMode) debug := true cfg := &config.Config{IsDebug: &debug} router := gin.New() adminGroup := router.Group(adminAPIPrefix) registerRoutes(router, adminGroup, cfg, nil, logging.GetLogger()) if err := rbac.VerifyRoutes(router.Routes(), adminAPIPrefix); err != nil { t.Fatal(err) } }