@Override
    protected AuthorizationInfo doGetAuthorizationInfo(final PrincipalCollection principalCollection) {
        UserInfo userInfo = (UserInfo) principalCollection.getPrimaryPrincipal();
        Set<String> permissions = permissionService.getAuthPermByUserName(userInfo.getUserName());
        if (CollectionUtils.isEmpty(permissions)) {
            return null;
        }
        SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
        simpleAuthorizationInfo.setStringPermissions(permissions);

        return simpleAuthorizationInfo;
    }
@Test
    public void testDoGetAuthorizationInfo() {
        PrincipalCollection principalCollection = mock(PrincipalCollection.class);
        UserInfo userInfo = new UserInfo();

        Set<String> strings = new HashSet<>();
        when(principalCollection.getPrimaryPrincipal()).thenReturn(userInfo);
        when(permissionService.getAuthPermByUserName(any())).thenReturn(strings);
        assertNull(shiroRealm.doGetAuthorizationInfo(principalCollection));

        strings.add("test");
        when(principalCollection.getPrimaryPrincipal()).thenReturn(userInfo);
        when(permissionService.getAuthPermByUserName(any())).thenReturn(strings);
        AuthorizationInfo info = shiroRealm.doGetAuthorizationInfo(principalCollection);
        assertEquals(strings, info.getStringPermissions());
    }