批量格式化代码

This commit is contained in:
Binary Wang
2017-05-11 17:07:08 +08:00
parent 5f887739a3
commit 8982cf8471
223 changed files with 2425 additions and 2793 deletions

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.bean;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.*;
import org.testng.annotations.*;
@Test
public class WxAccessTokenTest {

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean;
import me.chanjar.weixin.common.bean.result.WxError;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.*;
import org.testng.annotations.*;
@Test
public class WxErrorTest {

View File

@ -1,12 +1,10 @@
package me.chanjar.weixin.common.bean;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.menu.WxMenuButton;
import me.chanjar.weixin.common.bean.menu.WxMenuRule;
import org.testng.*;
import org.testng.annotations.*;
@Test
public class WxMenuTest {
@ -87,75 +85,75 @@ public class WxMenuTest {
Object[][] res = menuJson();
String json = "{ \"menu\" : " + res[0][0] + " }";
return new Object[][]{
new Object[]{json}
new Object[]{json}
};
}
@DataProvider(name = "wxPushMenu")
public Object[][] menuJson() {
String json =
"{"
+ "\"button\":["
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"今日歌曲\","
+ "\"key\":\"V1001_TODAY_MUSIC\""
+ "},"
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"歌手简介\","
+ "\"key\":\"V1001_TODAY_SINGER\""
+ "},"
+ "{"
+ "\"name\":\"菜单\","
+ "\"sub_button\":["
+ "{"
+ "\"type\":\"view\","
+ "\"name\":\"搜索\","
+ "\"url\":\"http://www.soso.com/\""
+ "},"
+ "{"
+ "\"type\":\"view\","
+ "\"name\":\"视频\","
+ "\"url\":\"http://v.qq.com/\""
+ "},"
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"赞一下我们\","
+ "\"key\":\"V1001_GOOD\""
+ "}"
+ "]"
+ "}"
+ "]"
+ "}";
"{"
+ "\"button\":["
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"今日歌曲\","
+ "\"key\":\"V1001_TODAY_MUSIC\""
+ "},"
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"歌手简介\","
+ "\"key\":\"V1001_TODAY_SINGER\""
+ "},"
+ "{"
+ "\"name\":\"菜单\","
+ "\"sub_button\":["
+ "{"
+ "\"type\":\"view\","
+ "\"name\":\"搜索\","
+ "\"url\":\"http://www.soso.com/\""
+ "},"
+ "{"
+ "\"type\":\"view\","
+ "\"name\":\"视频\","
+ "\"url\":\"http://v.qq.com/\""
+ "},"
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"赞一下我们\","
+ "\"key\":\"V1001_GOOD\""
+ "}"
+ "]"
+ "}"
+ "]"
+ "}";
return new Object[][]{
new Object[]{json}
new Object[]{json}
};
}
@DataProvider(name = "wxAddConditionalMenu")
public Object[][] addConditionalMenuJson() {
String json =
"{"
+ "\"button\":["
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"今日歌曲\","
+ "\"key\":\"V1001_TODAY_MUSIC\""
+ "}"
+ "],"
+ "\"matchrule\":{"
+ "\"group_id\":\"2\","
+ "\"sex\":\"1\","
+ "\"country\":\"中国\","
+ "\"province\":\"广东\","
+ "\"city\":\"广州\","
+ "\"client_platform_type\":\"2\","
+ "\"language\":\"zh_CN\""
+ "}"
+ "}";
"{"
+ "\"button\":["
+ "{"
+ "\"type\":\"click\","
+ "\"name\":\"今日歌曲\","
+ "\"key\":\"V1001_TODAY_MUSIC\""
+ "}"
+ "],"
+ "\"matchrule\":{"
+ "\"group_id\":\"2\","
+ "\"sex\":\"1\","
+ "\"country\":\"中国\","
+ "\"province\":\"广东\","
+ "\"city\":\"广州\","
+ "\"client_platform_type\":\"2\","
+ "\"language\":\"zh_CN\""
+ "}"
+ "}";
return new Object[][]{
new Object[]{json}
new Object[]{json}
};
}

View File

@ -1,8 +1,7 @@
package me.chanjar.weixin.common.session;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.*;
import org.testng.annotations.*;
@Test
public class SessionTest {
@ -11,7 +10,7 @@ public class SessionTest {
public Object[][] getSessionManager() {
return new Object[][]{
new Object[]{new StandardSessionManager()}
new Object[]{new StandardSessionManager()}
};
}

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.util;
import me.chanjar.weixin.common.api.WxMessageInMemoryDuplicateChecker;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.*;
import org.testng.annotations.*;
@Test
public class WxMessageInMemoryDuplicateCheckerTest {

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.common.util.crypto;
import org.testng.annotations.Test;
import org.testng.annotations.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@ -13,8 +13,7 @@ import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.io.StringReader;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import static org.testng.Assert.*;
@Test
public class WxCryptUtilTest {
@ -77,7 +76,7 @@ public class WxCryptUtilTest {
}
public void testValidateSignatureError() throws ParserConfigurationException, SAXException,
IOException {
IOException {
try {
WxCryptUtil pc = new WxCryptUtil(this.token, this.encodingAesKey, this.appId);
String afterEncrpt = pc.encrypt(this.replyMsg);

View File

@ -10,8 +10,8 @@
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT"/>
</root>
<logger name="me.chanjar.weixin.common" level="debug" />
<logger name="me.chanjar.weixin.common" level="debug"/>
</configuration>

View File

@ -8,7 +8,7 @@
<class name="me.chanjar.weixin.common.bean.WxMenuTest"/>
<class name="me.chanjar.weixin.common.util.crypto.WxCryptUtilTest"/>
<class name="me.chanjar.weixin.common.util.WxMessageInMemoryDuplicateCheckerTest"/>
<class name="me.chanjar.weixin.common.session.SessionTest" />
<class name="me.chanjar.weixin.common.session.SessionTest"/>
</classes>
</test>
</suite>