package com.qmth.distributed.print;

import com.alibaba.fastjson.JSON;
import com.qmth.teachcloud.common.service.SysOrgService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @Description: 系统机构服务类测试
 * @Author: CaoZixuan
 * @Date: 2022-02-09
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class SysOrgServiceTest {
    @Resource
    private SysOrgService sysOrgService;

    @Test
    public void testFindDeepOrgIdListByUserId(){
        Long userId = 198146821464260608L;
        Set<Long> orgIdList = sysOrgService.findDeepOrgIdListByUserId(userId);
        System.out.println(JSON.toJSONString(orgIdList));
    }

    @Test
    public void testFindDeepOrgIdListByOrgIdList(){
        List<Long> orgIdList = new ArrayList<>();
        orgIdList.add(167590127315451904L);
        orgIdList.add(198040177245945856L);
        Set<Long> result = sysOrgService.findDeepOrgIdListByOrgIdList(orgIdList);
        System.out.println(JSON.toJSONString(result));
    }
}
