From 3debeb035a2b76cdc29e8a65467e05eb3642dff8 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Tue, 30 Oct 2018 21:17:24 +0800 Subject: [PATCH] =?UTF-8?q?chore[litemall-core,litemall-wx-api]:=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../litemall/core}/ExpressTest.java | 2 +- .../org/linlinjava/litemall/core/SmsTest.java | 41 ++++++++++++------- .../litemall/core/WxTemplateTest.java | 35 ---------------- 3 files changed, 28 insertions(+), 50 deletions(-) rename {litemall-wx-api/src/test/java/org/linlinjava/litemall/wx => litemall-core/src/test/java/org/linlinjava/litemall/core}/ExpressTest.java (95%) delete mode 100644 litemall-core/src/test/java/org/linlinjava/litemall/core/WxTemplateTest.java diff --git a/litemall-wx-api/src/test/java/org/linlinjava/litemall/wx/ExpressTest.java b/litemall-core/src/test/java/org/linlinjava/litemall/core/ExpressTest.java similarity index 95% rename from litemall-wx-api/src/test/java/org/linlinjava/litemall/wx/ExpressTest.java rename to litemall-core/src/test/java/org/linlinjava/litemall/core/ExpressTest.java index 16e60d92..ce05ce6a 100644 --- a/litemall-wx-api/src/test/java/org/linlinjava/litemall/wx/ExpressTest.java +++ b/litemall-core/src/test/java/org/linlinjava/litemall/core/ExpressTest.java @@ -1,4 +1,4 @@ -package org.linlinjava.litemall.wx; +package org.linlinjava.litemall.core; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/litemall-core/src/test/java/org/linlinjava/litemall/core/SmsTest.java b/litemall-core/src/test/java/org/linlinjava/litemall/core/SmsTest.java index 0499fe31..10b422a8 100644 --- a/litemall-core/src/test/java/org/linlinjava/litemall/core/SmsTest.java +++ b/litemall-core/src/test/java/org/linlinjava/litemall/core/SmsTest.java @@ -28,20 +28,6 @@ public class SmsTest { @Autowired private NotifyService notifyService; - @Test - public void testSingle() { - String phone = "xxxxxxxxxxx"; - // 这里的短信签名必须在短信管理平台内设置正确并且相符合 - String msg = "【xxx】你的验证码为:123456,请与2分钟内填写,如非本人操作,请忽略本短信。"; - notifyService.notifySms(phone, msg); - - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - @Test public void testCaptcha() { String phone = "xxxxxxxxxxx"; @@ -70,4 +56,31 @@ public class SmsTest { } } + @Test + public void testShip() { + String phone = "xxxxxxxxxxx"; + String[] params = new String[] {"123456"}; + + notifyService.notifySmsTemplate(phone, NotifyType.SHIP, params); + + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + @Test + public void testRefund() { + String phone = "xxxxxxxxxxx"; + String[] params = new String[] {"123456"}; + + notifyService.notifySmsTemplate(phone, NotifyType.REFUND, params); + + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } } diff --git a/litemall-core/src/test/java/org/linlinjava/litemall/core/WxTemplateTest.java b/litemall-core/src/test/java/org/linlinjava/litemall/core/WxTemplateTest.java deleted file mode 100644 index f0eb2cbc..00000000 --- a/litemall-core/src/test/java/org/linlinjava/litemall/core/WxTemplateTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.linlinjava.litemall.core; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.linlinjava.litemall.core.notify.NotifyService; -import org.linlinjava.litemall.core.notify.NotifyType; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; - -/** - */ -@WebAppConfiguration -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest -public class WxTemplateTest { - - @Autowired - private NotifyService notifyService; - - @Test - public void testPaySucceed() { - String touser = "xx"; - String[] params = new String[]{"xxx"}; - notifyService.notifyWxTemplate(touser, NotifyType.PAY_SUCCEED, params); - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - -}