package cn.axzo.msg.center.service.pending.client;

import cn.axzo.msg.center.MsgCenterApplication;
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
import cn.azxo.framework.common.model.CommonResponse;
import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor;
import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

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

/**
 * @author yanglin
 */
@SpringBootTest(classes = MsgCenterApplication.class)
@RequiredArgsConstructor(onConstructor_ = @Autowired)
class PendingMessageClientTest {
    private final PendingMessageClient pendingMessageClient;

    @Test
    void foo() {
        @Language("JSON") String str = "{\n" +
                "  \"personId\": 22375,\n" +
                "  \"roleCategory\": \"EXECUTOR\",\n" +
                "  \"msgState\": \"HAS_BEEN_SENT\",\n" +
                "  \"ouId\": 7314,\n" +
                "  \"queryTemplateTerminals\": true,\n" +
                "  \"a\": {\n" +
                "    \"collectSql\": true\n" +
                "  },\n" +
                "  \"page\": 1,\n" +
                "  \"pageSize\": 100\n" +
                "}";
        PendingMessagePageRequest request = JSON.parseObject(str, PendingMessagePageRequest.class);
        CommonResponse<AnalysisPage<PendingMessageResponse>> analysisPageCommonResponse = pendingMessageClient.pageQuery(request);
        System.out.println();
    }

}