🐛 #1220 修复公众号永久素材相关的部分okhttp实现有问题的接口

This commit is contained in:
Binary Wang
2019-09-22 23:26:09 +08:00
parent df1aa5c9dc
commit 779f1d08a9
6 changed files with 45 additions and 34 deletions

View File

@ -9,16 +9,16 @@ import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.test.ApiTestModule;
import me.chanjar.weixin.mp.api.test.TestConstants;
import me.chanjar.weixin.mp.bean.material.*;
import org.testng.annotations.*;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.*;
/**
* 素材管理相关接口的测试
@ -27,7 +27,7 @@ import static org.testng.Assert.assertTrue;
* @author codepiano
* @author Binary Wang
*/
@Test(groups = "materialAPI")
@Test
@Guice(modules = ApiTestModule.class)
public class WxMpMaterialServiceImplTest {
@Inject
@ -175,7 +175,7 @@ public class WxMpMaterialServiceImplTest {
}
}
@Test(dependsOnMethods = {"testAddNews","testUploadMaterial"})
@Test(dependsOnMethods = {"testAddNews", "testUploadMaterial"})
public void testGetNewsInfo() throws WxErrorException {
WxMpMaterialNews wxMpMaterialNewsSingle = this.wxService
.getMaterialService().materialNewsInfo(this.singleNewsMediaId);
@ -243,6 +243,15 @@ public class WxMpMaterialServiceImplTest {
@Test(dependsOnMethods = {"testMaterialFileList"}, dataProvider = "allTestMaterial")
public void testDeleteMaterial(String mediaId) throws WxErrorException {
this.delete(mediaId);
}
@Test
public void testDeleteMaterialDirectly() throws WxErrorException {
this.delete("abc");
}
public void delete(String mediaId) throws WxErrorException {
boolean result = this.wxService.getMaterialService().materialDelete(mediaId);
assertTrue(result);
}