fix problem test unit
This commit is contained in:
@@ -50,6 +50,7 @@ public class WxMessageRouterTest {
|
|||||||
public void test() {
|
public void test() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DataProvider(name="messages-1")
|
@DataProvider(name="messages-1")
|
||||||
public Object[][] messages2() {
|
public Object[][] messages2() {
|
||||||
WxXmlMessage message1 = new WxXmlMessage();
|
WxXmlMessage message1 = new WxXmlMessage();
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class WxServiceTest {
|
|||||||
Assert.assertTrue(StringUtils.isNotBlank(after));
|
Assert.assertTrue(StringUtils.isNotBlank(after));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dependsOnMethods = "testRefreshAccessToken", enabled = false)
|
@Test(dependsOnMethods = "testRefreshAccessToken", enabled = true)
|
||||||
public void sendCustomMessage() throws WxErrorException {
|
public void sendCustomMessage() throws WxErrorException {
|
||||||
WxXmlConfigStorage configProvider = (WxXmlConfigStorage) wxService.wxConfigStorage;
|
WxXmlConfigStorage configProvider = (WxXmlConfigStorage) wxService.wxConfigStorage;
|
||||||
WxCustomMessage message = new WxCustomMessage();
|
WxCustomMessage message = new WxCustomMessage();
|
||||||
@@ -56,17 +56,17 @@ public class WxServiceTest {
|
|||||||
wxService.sendCustomMessage(message);
|
wxService.sendCustomMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "menu", dependsOnMethods = "testRefreshAccessToken", enabled = false)
|
@Test(dataProvider = "menu", dependsOnMethods = "testRefreshAccessToken", enabled = true)
|
||||||
public void testCreateMenu(WxMenu wxMenu) throws WxErrorException {
|
public void testCreateMenu(WxMenu wxMenu) throws WxErrorException {
|
||||||
wxService.createMenu(wxMenu);
|
wxService.createMenu(wxMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dependsOnMethods = { "testRefreshAccessToken" , "testCreateMenu"}, enabled = false)
|
@Test(dependsOnMethods = { "testRefreshAccessToken" , "testCreateMenu"}, enabled = true)
|
||||||
public void testGetMenu() throws WxErrorException {
|
public void testGetMenu() throws WxErrorException {
|
||||||
Assert.assertNotNull(wxService.getMenu());
|
Assert.assertNotNull(wxService.getMenu());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dependsOnMethods = { "testRefreshAccessToken", "testGetMenu" }, enabled = false)
|
@Test(dependsOnMethods = { "testRefreshAccessToken", "testGetMenu" }, enabled = true)
|
||||||
public void testDeleteMenu() throws WxErrorException {
|
public void testDeleteMenu() throws WxErrorException {
|
||||||
wxService.deleteMenu();
|
wxService.deleteMenu();
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,9 @@ public class WxServiceTest {
|
|||||||
public void testUploadMedia1(String mediaType, String fileType, String fileName) throws WxErrorException, IOException {
|
public void testUploadMedia1(String mediaType, String fileType, String fileName) throws WxErrorException, IOException {
|
||||||
InputStream inputStream = ClassLoader.getSystemResourceAsStream(fileName);
|
InputStream inputStream = ClassLoader.getSystemResourceAsStream(fileName);
|
||||||
WxUploadResult res = wxService.uploadMedia(mediaType, fileType, inputStream);
|
WxUploadResult res = wxService.uploadMedia(mediaType, fileType, inputStream);
|
||||||
System.out.println(res.toString());
|
Assert.assertNotNull(res.getType());
|
||||||
|
Assert.assertNotNull(res.getCreated_at());
|
||||||
|
Assert.assertTrue(res.getMedia_id() != null || res.getThumb_media_id() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DataProvider
|
@DataProvider
|
||||||
@@ -90,7 +92,7 @@ public class WxServiceTest {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = true)
|
||||||
public void testCheckSignature() throws WxErrorException {
|
public void testCheckSignature() throws WxErrorException {
|
||||||
String timestamp = "23234235423246";
|
String timestamp = "23234235423246";
|
||||||
String nonce = "y7didfkcmvnbd90sdofjkiefhsd";
|
String nonce = "y7didfkcmvnbd90sdofjkiefhsd";
|
||||||
|
|||||||
Reference in New Issue
Block a user