@Override
    public List<OAuth2ApproveDO> getApproveList(Long userId, Integer userType, String clientId) {
        List<OAuth2ApproveDO> approveDOs = oauth2ApproveMapper.selectListByUserIdAndUserTypeAndClientId(
                userId, userType, clientId);
        approveDOs.removeIf(o -> DateUtils.isExpired(o.getExpiresTime()));
        return approveDOs;
    }
@Test
    public void testGetApproveList() {
        // 准备参数
        Long userId = 10L;
        Integer userType = UserTypeEnum.ADMIN.getValue();
        String clientId = randomString();
        // mock 数据
        OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class).setUserId(userId)
                .setUserType(userType).setClientId(clientId).setExpiresTime(LocalDateTimeUtil.offset(LocalDateTime.now(), 1L, ChronoUnit.DAYS));
        oauth2ApproveMapper.insert(approve); // 未过期
        oauth2ApproveMapper.insert(ObjectUtil.clone(approve).setId(null)
                .setExpiresTime(LocalDateTimeUtil.offset(LocalDateTime.now(), -1L, ChronoUnit.DAYS))); // 已过期

        // 调用
        List<OAuth2ApproveDO> result = oauth2ApproveService.getApproveList(userId, userType, clientId);
        // 断言
        assertEquals(1, result.size());
        assertPojoEquals(approve, result.get(0));
    }