package com.njcn.msgpush.module.push.sms;

import com.njcn.msgpush.module.push.client.channel.sms.Impl.TelecomSmsClient;
import com.njcn.msgpush.module.push.client.channel.sms.factory.SmsFactory;
import com.njcn.msgpush.module.push.client.constant.ClientConstant;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author caozehui
 * @data 2026-02-10
 */
@SpringBootTest
public class TelecomSmsClientTest {

    @Autowired
    private SmsFactory smsFactory;

    @Test
    public void testSendSms() throws Exception {
        Map<String, Object> params = new HashMap<>();
//        params.put(TelecomSmsClient.ACCOUNT, "925631");
//        params.put(TelecomSmsClient.PASSWORD, "AMW2pOVrdky");
        params.put(TelecomSmsClient.CONTENT, "【南京灿能电力】这是JUnit群发短信测试，请忽略。时间：" + LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));

        smsFactory.getClient(ClientConstant.TELECOM).sendSms(params, "18839431215");
    }
}
