package cn.axzo.msg.center.api;

import cn.axzo.msg.center.MsgCenterApplication;
import cn.axzo.msg.center.api.request.v3.MessageSendReqV3;
import cn.axzo.msg.center.service.dto.PersonV3DTO;
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.Arrays;

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

/**
 * @author yanglin
 */
@SpringBootTest(classes = MsgCenterApplication.class)
@RequiredArgsConstructor(onConstructor_ = @Autowired)
class MessageAPIV3Test {
    private final MessageAPIV3 messageAPIV3;

    @Test
    void foo() throws Exception {
        MessageSendReqV3 req = new MessageSendReqV3();
        req.setSender(new PersonV3DTO(-99L));
        req.setReceivers(Arrays.asList(new PersonV3DTO(2810L)));
        req.setBizEventMappingCode("operator_news");
        req.setBizCode("operator_news");
        messageAPIV3.send(req);

        Thread.sleep(100000L);
    }

}