1
0
mirror of synced 2025-12-22 00:48:00 +08:00

添加获得模板列表的接口方法,并重构模板消息相关类包结构 for issue #63

This commit is contained in:
Binary Wang
2016-10-18 00:07:14 +08:00
parent d7298ab790
commit 6dc0481d1d
10 changed files with 196 additions and 36 deletions

View File

@@ -2,6 +2,7 @@ package me.chanjar.weixin.mp.api.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.testng.Assert;
import org.testng.annotations.Guice;
@@ -12,9 +13,10 @@ import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.api.ApiTestModule;
import me.chanjar.weixin.mp.api.WxXmlMpInMemoryConfigStorage;
import me.chanjar.weixin.mp.bean.WxMpIndustry;
import me.chanjar.weixin.mp.bean.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.WxMpTemplateMessage;
import me.chanjar.weixin.mp.bean.template.WxMpTemplate;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
/**
* <pre>
@@ -45,15 +47,15 @@ public class WxMpTemplateMsgServiceImplTest {
@Test
public void testGetIndustry() throws Exception {
final WxMpIndustry industry = this.wxService.getTemplateMsgService().getIndustry();
final WxMpTemplateIndustry industry = this.wxService.getTemplateMsgService().getIndustry();
Assert.assertNotNull(industry);
System.out.println(industry);
}
@Test
public void testSetIndustry() throws Exception {
WxMpIndustry industry = new WxMpIndustry(new WxMpIndustry.Industry("1"),
new WxMpIndustry.Industry("04"));
WxMpTemplateIndustry industry = new WxMpTemplateIndustry(new WxMpTemplateIndustry.Industry("1"),
new WxMpTemplateIndustry.Industry("04"));
boolean result = this.wxService.getTemplateMsgService().setIndustry(industry);
Assert.assertTrue(result);
}
@@ -65,4 +67,11 @@ public class WxMpTemplateMsgServiceImplTest {
System.err.println(result);
}
@Test
public void testGetAllPrivateTemplate() throws Exception {
List<WxMpTemplate> result = this.wxService.getTemplateMsgService().getAllPrivateTemplate();
Assert.assertNotNull(result);
System.err.println(result);
}
}