新增测试代码

This commit is contained in:
wenc000 2020-10-20 10:10:37 +08:00
parent 75496131a6
commit 71e7b5ed3d
2 changed files with 43 additions and 0 deletions

View File

@ -24,6 +24,13 @@
<artifactId>qcloudsms</artifactId> <artifactId>qcloudsms</artifactId>
<version>1.0.6</version> <version>1.0.6</version>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,36 @@
import com.cm.manager.sms.config.properties.SmsDefaultProperties;
import com.cm.manager.sms.utils.DefaultSmsUtil;
import org.junit.Test;
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: SmsTest
* @Description: 短信测试
* @Author: WangGeng
* @Date: 2020/10/20 9:39
* @Version: 1.0
**/
public class SmsTest {
@Test
public void test() {
// 包头政法 btzfw
// 西藏日喀则 xzrkz
String account = "xzrkz";
String password = "xzrkz123";
String phone = "15147146676";
StringBuilder contentSB = new StringBuilder("【山西腾狮科技】").append("测试短信");
String url = "https://dx.ipyy.net/sms.aspx?action=send&userid=&account={account}&password={password}&mobile={mobile}&content={content}&sendTime=&extno={extno}";
String[] paramArray = new String[]{
account,
password,
phone,
contentSB.toString(),
phone
};
DefaultSmsUtil.sendSms(url, paramArray);
}
}