🆕 #2261 【小程序】增加内容安全接口(兼容2.0版本)
This commit is contained in:
@@ -2,6 +2,8 @@ package cn.binarywang.wx.miniapp.api.impl;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import cn.binarywang.wx.miniapp.bean.security.WxMaMsgSecCheckCheckRequest;
|
||||
import cn.binarywang.wx.miniapp.bean.security.WxMaMsgSecCheckCheckResponse;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
@@ -49,4 +51,16 @@ public class WxMaSecCheckServiceImplTest {
|
||||
.checkMessage(msg))
|
||||
.isEqualTo(result);
|
||||
}
|
||||
|
||||
@Test(dataProvider = "secData")
|
||||
public void testCheckMessage2(String msg, boolean result) throws WxErrorException {
|
||||
WxMaMsgSecCheckCheckRequest request = WxMaMsgSecCheckCheckRequest.builder()
|
||||
.content(msg)
|
||||
.scene(1)
|
||||
.version("2")
|
||||
.openid("xxx")
|
||||
.build();
|
||||
WxMaMsgSecCheckCheckResponse response = this.wxService.getSecCheckService().checkMessage(request);
|
||||
assertThat(response).isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,11 @@ public class WxMaShopImgServiceImplTest {
|
||||
WxMinishopImageUploadCustomizeResult result = wxService.getShopImgService().uploadImg(file);
|
||||
assertThat(result).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUploadImg2() throws WxErrorException {
|
||||
File file = new File("/Users/liming/Desktop/test.jpeg");
|
||||
WxMinishopImageUploadCustomizeResult result = wxService.getShopImgService().uploadImg(file, "1");
|
||||
assertThat(result).isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user