forked from baron/baron-sso
네이버 계정 정합성 맞춤
This commit is contained in:
@@ -134,6 +134,27 @@ func TestRedisServiceFlushIdentityCacheDeletesOnlyIdentityMirrorAndIndexKeys(t *
|
||||
}, stub.deleted)
|
||||
}
|
||||
|
||||
func TestRedisServiceDeleteByPrefixScansAndDeletesMatchingKeys(t *testing.T) {
|
||||
stub := &redisCommandStub{
|
||||
scans: map[string][]string{
|
||||
"orgchart:snapshot:v1:*": {
|
||||
"orgchart:snapshot:v1:super_admin:all:none",
|
||||
"orgchart:snapshot:v1:user:user-1:tenant-1",
|
||||
},
|
||||
},
|
||||
}
|
||||
service := newStubbedRedisService(stub)
|
||||
|
||||
deleted, err := service.DeleteByPrefix(context.Background(), "orgchart:snapshot:v1:")
|
||||
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(2), deleted)
|
||||
require.ElementsMatch(t, []string{
|
||||
"orgchart:snapshot:v1:super_admin:all:none",
|
||||
"orgchart:snapshot:v1:user:user-1:tenant-1",
|
||||
}, stub.deleted)
|
||||
}
|
||||
|
||||
func TestRedisServiceGetIdentityCacheStatusReturnsUnavailableWithoutClient(t *testing.T) {
|
||||
status, err := (*RedisService)(nil).GetIdentityCacheStatus(context.Background())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user