48 lines
2.6 KiB
Java
48 lines
2.6 KiB
Java
package com.kimgo.wepush.service;
|
||
|
||
import com.kimgo.wepush.model.SMSInfo;
|
||
import com.kimgo.wepush.response.ServerResponseEntity;
|
||
import org.junit.jupiter.api.Test;
|
||
import org.slf4j.Logger;
|
||
import org.slf4j.LoggerFactory;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.boot.test.context.SpringBootTest;
|
||
|
||
import static org.junit.jupiter.api.Assertions.*;
|
||
|
||
@SpringBootTest
|
||
class SMSServiceTest {
|
||
private final Logger logger = LoggerFactory.getLogger(SMSServiceTest.class);
|
||
@Autowired
|
||
private SMSService smsService;
|
||
@Test
|
||
public void testMessageSize(){
|
||
String message = "【话费剩余】\n" +
|
||
"您所在的家庭账户本月通信费87.90元,余额20.91元,其中本机本月累计消费87.90元(由家庭账户统一支付),家庭成员13541758298本月费用0.00元,家庭成员20935981572本月费用0.00元。新爱家58共享话费58.00元,当前剩余0.00元,\n" +
|
||
"【流量查询】\n" +
|
||
"国内通用流量共15.00GB,当前可使用14.95GB。回CXLL查明细。\n" +
|
||
"【套餐剩余】\n" +
|
||
"移动68套餐基本通话优惠分钟数余200分钟。\n" +
|
||
"发送“0000”到“10086”,订购业务清清楚楚,一键退订轻轻松松。\n" +
|
||
"【已开业务】回“1”\n" +
|
||
"【流量超市】回“2”\n" +
|
||
"【消费情况】回“3”\n" +
|
||
"【20元/月→4GB国内流量】回“4”\n" +
|
||
"【30元/月→10GB国内流量】回“5”\n" +
|
||
"【60元/月→30GB国内流量】回“6”\n" +
|
||
"【7天流量包】回“7”\n" +
|
||
"【19.9元/月→5GB国内流量+视频会员】回“8”\n" +
|
||
"【宽带专区】回“9”\n" +
|
||
"【在线客服】若您有话费/流量疑问、业务咨询/退订等其他需求可联系在线文字客服,点击官方认证通道: https://dx.10086.cn/Q_HZBg \n" +
|
||
"【为您推荐】尊敬的客户,您好!您有10元话费券待领取: http://dx.10086.cn/D/jEd1Jq ,点击查看话费使用详情: https://dx.10086.cn/38UvEQ 。。【中国移动】";
|
||
|
||
String accessToken = "gKGCDSgWV82XbU0H";
|
||
SMSInfo smsInfo = new SMSInfo();
|
||
smsInfo.setSmsContent(message);
|
||
smsInfo.setSmsNumber("11111");
|
||
smsInfo.setSmsAcceptanceTime("11111");
|
||
|
||
ServerResponseEntity serverResponseEntity = smsService.getSMSInfo(accessToken,smsInfo);
|
||
logger.info(serverResponseEntity.toString());
|
||
}
|
||
} |