sync: 同步 v1.0.4 并脱敏配置与镜像
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
|
||||
)
|
||||
|
||||
func TestFullSyncMonitorPermissionDeclarations(t *testing.T) {
|
||||
// A slice of pairs rather than a map: request structs may contain slice
|
||||
// fields (for example the channel scope), which are not hashable.
|
||||
checks := []struct {
|
||||
request any
|
||||
want string
|
||||
}{
|
||||
{v1.FullSyncRunsListReq{}, "cpm:iot:fullSyncRuns:view"},
|
||||
{v1.FullSyncRunDetailReq{}, "cpm:iot:fullSyncRuns:view"},
|
||||
{v1.FullSyncRunFailuresReq{}, "cpm:iot:fullSyncRuns:failures"},
|
||||
{v1.FullSyncRunStartReq{}, "cpm:iot:fullSyncRuns:start"},
|
||||
{v1.FullSyncChannelOptionsReq{}, "cpm:iot:fullSyncRuns:view"},
|
||||
}
|
||||
for _, check := range checks {
|
||||
if got := gmeta.Get(check.request, "x-check-permission").String(); got != check.want {
|
||||
t.Fatalf("%T permission = %q, want %q", check.request, got, check.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user