feat: add platform resource audit baseline
This commit is contained in:
22
backend/api/internal/routers/platform_test.go
Normal file
22
backend/api/internal/routers/platform_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestPlatformGasRouteUsesGasBasic(t *testing.T) {
|
||||
engine := gin.New()
|
||||
RegisterPlatform("heqi", engine)
|
||||
|
||||
for _, route := range engine.Routes() {
|
||||
if route.Path == "/heqi/platform/v1/gas/gas_station" {
|
||||
t.Fatal("gas station route must use gas_basic as its resource name")
|
||||
}
|
||||
if route.Method == "GET" && route.Path == "/heqi/platform/v1/gas/gas_basic" {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("gas_basic list route is not registered")
|
||||
}
|
||||
Reference in New Issue
Block a user