/*
package com.huimv.video.dhicc.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huimv.video.dhicc.entity.IccChannel;
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;

import com.alibaba.fastjson.JSONArray;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

*/
/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.biosafety.uface.controller
 * @Description : TODO
 * @Version : 1.0
 * @Author : ZhuoNing
 * @Create : 2020-12-25
 **//*

@SpringBootTest
public class ClientAllEventServiceImplTest {
    @Autowired
    private OauthConfigBaseInfo02 oauthConfigBaseInfo02;
    @Autowired
    private IIccChannelService iIccChannelService;

    @Test
    public void testPasrse(){
        String text = "IccResponse{result='{\"success\":true,\"code\":\"0\",\"errMsg\":\"success\",\"data\":104}', requestId='null', code='0', success=true, errMsg='success'}";
        System.out.println("text 1>>"+text);
        text = text.substring(text.indexOf("data"),text.length());
//        System.out.println("text 2>>"+text);
        text = text.substring(text.indexOf(":")+1,text.indexOf("}"));
        System.out.println("text 3>>"+text);
//        text = text.substring(0,text.length()-1);
//        System.out.println("text 3>>"+text);

//        JSONObject dataJo = JSON.parseObject(text);
//        System.out.println("dataJo>>"+dataJo);

    }
    @Test
    public void testChannel(){
        String remark = "22";
        ChannelRequestHn channelRequest = new ChannelRequestHn(oauthConfigBaseInfo02);
        JSONObject jsonObject = JSON.parseObject(channelRequest.doAction());
        String data = jsonObject.get("data").toString();
        JSONArray jsonValues = (JSONArray) JSON.parseObject(data).get("pageData");
        List<IccChannelVo> iccChannelVos = jsonValues.toJavaList(IccChannelVo.class);
        for (IccChannelVo iccChannelVo : iccChannelVos) {
            IccChannel iccChannel = new IccChannel();
            iccChannel.setChannelId(iccChannelVo.getChannelCode());
            iccChannel.setChannelName(iccChannelVo.getChannelName());
            iccChannel.setRemark(remark);
            iIccChannelService.save(iccChannel);
            System.out.println(iccChannelVo);
        }
    }
}
*/
