mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-02 21:26:01 +08:00
🐛 #1220 修复公众号永久素材相关的部分okhttp实现有问题的接口
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user