package cn.axzo.msg.center.inside.notices.service.impl;

import cn.axzo.msg.center.MsgCenterApplication;
import cn.axzo.msg.center.notices.manager.api.dto.request.plat.TingyunInterfaceListRequest;
import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Collections;
import java.util.Date;

import static org.junit.jupiter.api.Assertions.*;

/**
 * @author yanglin
 */
@SpringBootTest(classes = MsgCenterApplication.class)
@RequiredArgsConstructor(onConstructor_ = @Autowired)
class TingyunServiceTest {

    private final TingyunService tingyunService;

    @Test
    void foo() {
        TingyunInterfaceListRequest request = new TingyunInterfaceListRequest();
        request.setAuth("Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxOGM0M2IzZS0yZTdmLTQzOTMtODBiZS04MjVhZDJlYTlkNmYiLCJpZCI6ImYxYTQxNDdmLWNjNmEtNGNlMC04OGYyLWI4NmViMWU5ZWYzMiIsIm5hbWUiOiJkYmIwNThlMy1jZjhkLTQ0NjQtOTU4My02NjA5ZTBiY2VlMDEiLCJjb2RlIjoiNTNlYTE5ZTItMWI2NS00YTUyLTg5ZmUtN2NmNjAzZWE5NTg5IiwiYWdyZWVtZW50SWQiOiJjNDBlY2UzZS1jZTUzLTQ0NDgtODUzOC02N2NjOWU4OTkzOTMiLCJ0eXBlIjoiMWJmM2M0NWEtMTk3ZC00YzdiLTlhMWItOWEyNzlhOGYyMWM2IiwicmlnaHRSYW5nZSI6IjJlOTQxODQzLWYwZTQtNGIxZC1iNjQ1LTRlNjRhZTRjNWUyMyIsInJhbmRvbSI6ImZiMzczNjE5LTBkYWEtNDY4ZS1iOTM1LWUzYWZiYjMxNGRjMSJ9.OWTE9F0hBn1jJDukLoON3exQZuHVk16bGqo4dDnfQz5xytZiOWvnI9iUIopKjsv9nh4NkQC2h10sSTwFHpFpf31J-aNi112bc69nYvnTI-5NHs8gWywYJ3kSUB8tGobtQC4nWlMKHb1fdiS-0pO-FI8fYkI1c580ULdvP15IUESYW6rueNr-IcmV87XVVNWqrUm7jWP8vmpzI6_10MBUTp2uZD889e1mD_XHBErV_-h93GaNc_2Bluke1LizeNHGx5F1QU0ZGkzQWsst9trlGwvJWLYlJtsKlQPfBftGmkuDfPmp3QJPseWQPXtTcfA9xGvsxIaf3M9Rva7RRfCcFw");
        request.setEndDate(new Date());
        TingyunInterfaceListRequest.ActionInfo action = new TingyunInterfaceListRequest.ActionInfo();
        action.setApplicationId(64254L);
        action.setActionName("groupStatisticV2");
        request.setActions(Collections.singletonList(action));
        tingyunService.interfaceList(request);
    }

}