package com.nokia.sms.service;

import com.nokia.pushmessage.service.PushMessageService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * 使用联通集团能力商店发布的能力向钉钉群推送消息测试
 *
 * @author x
 * @date 2023/07/13
 */
@SpringBootTest
class DingTalkTest {
    String accessToken = "1339c4484acb660527acedea99419473f4529eb345982a96371c1b1f5c69cfa7";
    String prefix = "alert: ";
    @Autowired
    PushMessageService pushMessageService;

    @Test
    void sendTextMessageTest() {
        String message = "纯文本消息";
        pushMessageService.sendTextMessage(accessToken, prefix, message);
    }

    @Test
    void sendTextMessageAllTest() {
        String message = "纯文本消息@所有人";
        pushMessageService.sendTextMessage(accessToken, prefix, message, true);
    }
}
