kra-oa/internal/data/repository/system_init_ignore_test.go

23 lines
514 B
Go

package system
import "testing"
func TestDefaultIgnoredAPIsIncludeSwagger(t *testing.T) {
wants := map[string]bool{
"GET /swagger/*any": false,
"GET /uploads/file/*filepath": false,
"HEAD /uploads/file/*filepath": false,
}
for _, api := range DefaultIgnoredAPIs("uploads/file") {
key := api.Method + " " + api.Path
if _, ok := wants[key]; ok {
wants[key] = true
}
}
for key, found := range wants {
if !found {
t.Fatalf("default ignored APIs do not include %s", key)
}
}
}