This commit is contained in:
Livio Amstutz 2020-03-30 10:09:38 +02:00
parent e5e39b3a6a
commit 106a6ec143

View File

@ -27,7 +27,7 @@ func (v *testVerifier) GetProjectIDByClientID(ctx context.Context, clientID stri
return "", nil
}
func EqualStringArray(a, b []string) bool {
func equalStringArray(a, b []string) bool {
if len(a) != len(b) {
return false
}
@ -133,7 +133,7 @@ func Test_GetUserMethodPermissions(t *testing.T) {
t.Errorf("got wrong err: %v ", err)
}
if !tt.wantErr && !EqualStringArray(perms, tt.result) {
if !tt.wantErr && !equalStringArray(perms, tt.result) {
t.Errorf("got wrong result, expecting: %v, actual: %v ", tt.result, perms)
}
})
@ -239,7 +239,7 @@ func Test_MapGrantsToPermissions(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := mapGrantsToPermissions(tt.args.requiredPerm, tt.args.grants, tt.args.authConfig)
if !EqualStringArray(result, tt.result) {
if !equalStringArray(result, tt.result) {
t.Errorf("got wrong result, expecting: %v, actual: %v ", tt.result, result)
}
})
@ -346,7 +346,7 @@ func Test_MapRoleToPerm(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := mapRoleToPerm(tt.args.requiredPerm, tt.args.actualRole, tt.args.authConfig, tt.args.resolvedPermissions)
if !EqualStringArray(result, tt.result) {
if !equalStringArray(result, tt.result) {
t.Errorf("got wrong result, expecting: %v, actual: %v ", tt.result, result)
}
})