1
0
mirror of synced 2025-12-19 06:37:59 +08:00

🆕 #2261 【小程序】增加内容安全接口(兼容2.0版本)

This commit is contained in:
liming1019
2021-08-18 10:52:16 +08:00
committed by GitHub
parent 6cfe90b31e
commit 614a1c923e
14 changed files with 227 additions and 14 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}
}