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

🆕 #1429 增加小程序直播类相关接口

* #1429 增加小程序直播类相关接口

* 新增:获取所有直播间列表,区分分页

* 优化代码格式

Co-authored-by: yjwang <yjwang@wisu.com.cn>
This commit is contained in:
yjwang
2020-04-05 21:58:19 +08:00
committed by GitHub
parent 458c645fa4
commit a9766960c3
6 changed files with 318 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaGetLiveInfo;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import cn.binarywang.wx.miniapp.test.TestConfig;
import com.google.common.collect.ImmutableMap;
import com.google.gson.JsonObject;
import com.google.inject.Inject;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.util.List;
import java.util.stream.Collectors;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
/**
* 测试直播相关的接口
*
* @author <a href="https://github.com/yjwang3300300">yjwang</a>
*/
@Test
@Guice(modules = ApiTestModule.class)
public class WxMaLiveServiceImplTest {
@Inject
private WxMaService wxService;
@Test
public void getLiveInfo() throws Exception {
WxMaGetLiveInfo list = this.wxService.getLiveService().getLiveInfo(0,10);
assertNotNull(list);
System.out.println(list.toString());
}
@Test
public void getLiveReplay() throws Exception {
// [12, 11, 10, 9, 8, 7, 6, 5, 3, 2]
WxMaGetLiveInfo list = this.wxService.getLiveService().getLiveReplay(11,0,10);
assertNotNull(list);
System.out.println(list.toString());
}
@Test
public void getLiveinfos() throws Exception {
List<WxMaGetLiveInfo.RoomInfo> list = this.wxService.getLiveService().getLiveinfos();
assertNotNull(list);
System.out.println(list.toString());
}
}