//package com.mcli;
//
//import cn.hutool.core.date.DateUtil;
//import com.dingtalk.oapi.lib.aes.DingTalkEncryptException;
//import com.dingtalk.oapi.lib.aes.DingTalkEncryptor;
//import com.mcli.service.dingtalk.DDConf;
//import com.mcli.service.dingtalk.crypto.DingCallbackCrypto;
//import lombok.extern.slf4j.Slf4j;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import java.util.Date;
//
//@Slf4j
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = Boot.class)
//public class DDTest {
//
//    @Autowired
//    private DDClient ddClient;
//
//    @Autowired
//    private DDConf ddConf;
//
//    @Test
//    public void test() {
//        log.info("test, {}", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
//    }
//
//    @Test
//    public void cryto() throws DingCallbackCrypto.DingTalkEncryptException, DingTalkEncryptException {
//        DingCallbackCrypto callbackCrypto = new DingCallbackCrypto(ddConf.getToken(), ddConf.getAesKey(), ddConf.getAppKey());
//        log.info("cryto 111, {}", callbackCrypto.getEncryptedMap(DDConf.CALLBACK_RESPONSE));
//
//        DingTalkEncryptor dingTalkEncryptor = new DingTalkEncryptor(ddConf.getToken(), ddConf.getAesKey(), ddConf.getAppKey());
//        log.info("cryto 222, {}", dingTalkEncryptor.getEncryptedMap(DDConf.CALLBACK_RESPONSE, System.currentTimeMillis(), DingCallbackCrypto.Utils.getRandomStr(8)));
//    }
//}
