21 lines
611 B
Go
21 lines
611 B
Go
package router
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/gogf/gf/v2/util/gmeta"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
|
|
)
|
|
|
|
func TestFullSyncReplayPermissionDeclarations(t *testing.T) {
|
|
post := gmeta.Get(v1.FullSyncReplayReq{}, "x-check-permission").String()
|
|
get := gmeta.Get(v1.FullSyncReplayStatusReq{}, "x-check-permission").String()
|
|
if post != "cpm:iot:fullSyncRuns:replay" || get != "cpm:iot:fullSyncRuns:replay:view" {
|
|
t.Fatalf("permission metadata = %q, %q", post, get)
|
|
}
|
|
if strings.TrimSpace(post) == "" || strings.TrimSpace(get) == "" {
|
|
t.Fatal("missing permission")
|
|
}
|
|
}
|