Skip to content

Commit d42227c

Browse files
committed
fix warnings
1 parent cc59d27 commit d42227c

12 files changed

+53
-53
lines changed

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/ApiTestModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ public static class WxXmlCpInMemoryConfigStorage extends WxCpInMemoryConfigStora
3838
protected String tagId;
3939

4040
public String getUserId() {
41-
return userId;
41+
return this.userId;
4242
}
4343

4444
public void setUserId(String userId) {
4545
this.userId = userId;
4646
}
4747

4848
public String getDepartmentId() {
49-
return departmentId;
49+
return this.departmentId;
5050
}
5151

5252
public void setDepartmentId(String departmentId) {
5353
this.departmentId = departmentId;
5454
}
5555

5656
public String getTagId() {
57-
return tagId;
57+
return this.tagId;
5858
}
5959

6060
public void setTagId(String tagId) {
@@ -64,9 +64,9 @@ public void setTagId(String tagId) {
6464
@Override
6565
public String toString() {
6666
return super.toString() + " > WxXmlCpConfigStorage{" +
67-
"userId='" + userId + '\'' +
68-
", departmentId='" + departmentId + '\'' +
69-
", tagId='" + tagId + '\'' +
67+
"userId='" + this.userId + '\'' +
68+
", departmentId='" + this.departmentId + '\'' +
69+
", tagId='" + this.tagId + '\'' +
7070
'}';
7171
}
7272
}

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpBaseAPITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public class WxCpBaseAPITest {
2020
protected WxCpServiceImpl wxService;
2121

2222
public void testRefreshAccessToken() throws WxErrorException {
23-
WxCpConfigStorage configStorage = wxService.wxCpConfigStorage;
23+
WxCpConfigStorage configStorage = this.wxService.wxCpConfigStorage;
2424
String before = configStorage.getAccessToken();
25-
wxService.getAccessToken(false);
25+
this.wxService.getAccessToken(false);
2626

2727
String after = configStorage.getAccessToken();
2828

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpDepartAPITest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,34 @@ public void testDepartCreate() throws WxErrorException {
2828
depart.setName("子部门" + System.currentTimeMillis());
2929
depart.setParentId(1);
3030
depart.setOrder(1);
31-
Integer departId = wxCpService.departCreate(depart);
31+
Integer departId = this.wxCpService.departCreate(depart);
3232
}
3333

3434
@Test(dependsOnMethods = "testDepartCreate")
3535
public void testDepartGet() throws WxErrorException {
3636
System.out.println("=================获取部门");
37-
List<WxCpDepart> departList = wxCpService.departGet();
37+
List<WxCpDepart> departList = this.wxCpService.departGet();
3838
Assert.assertNotNull(departList);
3939
Assert.assertTrue(departList.size() > 0);
4040
for (WxCpDepart g : departList) {
41-
depart = g;
42-
System.out.println(depart.getId() + ":" + depart.getName());
41+
this.depart = g;
42+
System.out.println(this.depart.getId() + ":" + this.depart.getName());
4343
Assert.assertNotNull(g.getName());
4444
}
4545
}
4646

4747
@Test(dependsOnMethods = {"testDepartGet", "testDepartCreate"})
4848
public void testDepartUpdate() throws WxErrorException {
4949
System.out.println("=================更新部门");
50-
depart.setName("子部门改名" + System.currentTimeMillis());
51-
wxCpService.departUpdate(depart);
50+
this.depart.setName("子部门改名" + System.currentTimeMillis());
51+
this.wxCpService.departUpdate(this.depart);
5252
}
5353

5454
@Test(dependsOnMethods = "testDepartUpdate")
5555
public void testDepartDelete() throws WxErrorException {
5656
System.out.println("=================删除部门");
57-
System.out.println(depart.getId() + ":" + depart.getName());
58-
wxCpService.departDelete(depart.getId());
57+
System.out.println(this.depart.getId() + ":" + this.depart.getName());
58+
this.wxCpService.departDelete(this.depart.getId());
5959
}
6060

6161
}

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMediaAPITest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ public class WxCpMediaAPITest {
2727
@Inject
2828
protected WxCpServiceImpl wxService;
2929

30-
private List<String> media_ids = new ArrayList<String>();
30+
private List<String> media_ids = new ArrayList<>();
3131

3232
@Test(dataProvider = "uploadMedia")
3333
public void testUploadMedia(String mediaType, String fileType, String fileName) throws WxErrorException, IOException {
3434
InputStream inputStream = ClassLoader.getSystemResourceAsStream(fileName);
35-
WxMediaUploadResult res = wxService.mediaUpload(mediaType, fileType, inputStream);
35+
WxMediaUploadResult res = this.wxService.mediaUpload(mediaType, fileType, inputStream);
3636
Assert.assertNotNull(res.getType());
3737
Assert.assertNotNull(res.getCreatedAt());
3838
Assert.assertTrue(res.getMediaId() != null || res.getThumbMediaId() != null);
3939

4040
if (res.getMediaId() != null) {
41-
media_ids.add(res.getMediaId());
41+
this.media_ids.add(res.getMediaId());
4242
}
4343
if (res.getThumbMediaId() != null) {
44-
media_ids.add(res.getThumbMediaId());
44+
this.media_ids.add(res.getThumbMediaId());
4545
}
4646
}
4747

@@ -57,7 +57,7 @@ public Object[][] uploadMedia() {
5757

5858
@Test(dependsOnMethods = {"testUploadMedia"}, dataProvider = "downloadMedia")
5959
public void testDownloadMedia(String media_id) throws WxErrorException {
60-
wxService.mediaDownload(media_id);
60+
this.wxService.mediaDownload(media_id);
6161
}
6262

6363
@DataProvider

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageAPITest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ public class WxCpMessageAPITest {
2020
protected WxCpServiceImpl wxService;
2121

2222
public void testSendCustomMessage() throws WxErrorException {
23-
ApiTestModule.WxXmlCpInMemoryConfigStorage configStorage = (ApiTestModule.WxXmlCpInMemoryConfigStorage) wxService.wxCpConfigStorage;
23+
ApiTestModule.WxXmlCpInMemoryConfigStorage configStorage = (ApiTestModule.WxXmlCpInMemoryConfigStorage) this.wxService.wxCpConfigStorage;
2424
WxCpMessage message1 = new WxCpMessage();
2525
message1.setAgentId(configStorage.getAgentId());
2626
message1.setMsgType(WxConsts.CUSTOM_MSG_TEXT);
2727
message1.setToUser(configStorage.getUserId());
2828
message1.setContent("欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>");
29-
wxService.messageSend(message1);
29+
this.wxService.messageSend(message1);
3030

3131
WxCpMessage message2 = WxCpMessage
3232
.TEXT()
3333
.agentId(configStorage.getAgentId())
3434
.toUser(configStorage.getUserId())
3535
.content("欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>")
3636
.build();
37-
wxService.messageSend(message2);
37+
this.wxService.messageSend(message2);
3838

3939
}
4040

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageRouterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public WxEchoCpMessageHandler(StringBuffer sb, String echoStr) {
286286
@Override
287287
public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map<String, Object> context, WxCpService wxCpService,
288288
WxSessionManager sessionManager) {
289-
sb.append(this.echoStr).append(',');
289+
this.sb.append(this.echoStr).append(',');
290290
return null;
291291
}
292292

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpTagAPITest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,44 @@ public class WxCpTagAPITest {
2323
protected String tagId;
2424

2525
public void testTagCreate() throws Exception {
26-
tagId = wxService.tagCreate("测试标签4");
27-
System.out.println(tagId);
26+
this.tagId = this.wxService.tagCreate("测试标签4");
27+
System.out.println(this.tagId);
2828
}
2929

3030
@Test(dependsOnMethods = "testTagCreate")
3131
public void testTagUpdate() throws Exception {
32-
wxService.tagUpdate(tagId, "测试标签-改名");
32+
this.wxService.tagUpdate(this.tagId, "测试标签-改名");
3333
}
3434

3535
@Test(dependsOnMethods = "testTagUpdate")
3636
public void testTagGet() throws Exception {
37-
List<WxCpTag> tags = wxService.tagGet();
37+
List<WxCpTag> tags = this.wxService.tagGet();
3838
Assert.assertNotEquals(tags.size(), 0);
3939
}
4040

4141
@Test(dependsOnMethods = "testTagGet")
4242
public void testTagAddUsers() throws Exception {
43-
List<String> userIds = new ArrayList<String>();
44-
userIds.add(((ApiTestModule.WxXmlCpInMemoryConfigStorage) configStorage).getUserId());
45-
wxService.tagAddUsers(tagId, userIds, null);
43+
List<String> userIds = new ArrayList<>();
44+
userIds.add(((ApiTestModule.WxXmlCpInMemoryConfigStorage) this.configStorage).getUserId());
45+
this.wxService.tagAddUsers(this.tagId, userIds, null);
4646
}
4747

4848
@Test(dependsOnMethods = "testTagAddUsers")
4949
public void testTagGetUsers() throws Exception {
50-
List<WxCpUser> users = wxService.tagGetUsers(tagId);
50+
List<WxCpUser> users = this.wxService.tagGetUsers(this.tagId);
5151
Assert.assertNotEquals(users.size(), 0);
5252
}
5353

5454
@Test(dependsOnMethods = "testTagGetUsers")
5555
public void testTagRemoveUsers() throws Exception {
56-
List<String> userIds = new ArrayList<String>();
57-
userIds.add(((ApiTestModule.WxXmlCpInMemoryConfigStorage) configStorage).getUserId());
58-
wxService.tagRemoveUsers(tagId, userIds);
56+
List<String> userIds = new ArrayList<>();
57+
userIds.add(((ApiTestModule.WxXmlCpInMemoryConfigStorage) this.configStorage).getUserId());
58+
this.wxService.tagRemoveUsers(this.tagId, userIds);
5959
}
6060

6161
@Test(dependsOnMethods = "testTagRemoveUsers")
6262
public void testTagDelete() throws Exception {
63-
wxService.tagDelete(tagId);
63+
this.wxService.tagDelete(this.tagId);
6464
}
6565

6666
}

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpUserAPITest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testUserCreate() throws WxErrorException {
3535
user.setPosition("woman");
3636
user.setTel("3300393");
3737
user.addExtAttr("爱好", "table");
38-
wxCpService.userCreate(user);
38+
this.wxCpService.userCreate(user);
3939
}
4040

4141
@Test(dependsOnMethods = "testUserCreate")
@@ -44,23 +44,23 @@ public void testUserUpdate() throws WxErrorException {
4444
user.setUserId("some.woman");
4545
user.setName("Some Woman");
4646
user.addExtAttr("爱好", "table2");
47-
wxCpService.userUpdate(user);
47+
this.wxCpService.userUpdate(user);
4848
}
4949

5050
@Test(dependsOnMethods = "testUserUpdate")
5151
public void testUserGet() throws WxErrorException {
52-
WxCpUser user = wxCpService.userGet("some.woman");
52+
WxCpUser user = this.wxCpService.userGet("some.woman");
5353
Assert.assertNotNull(user);
5454
}
5555

5656
@Test(dependsOnMethods = "testUserGet")
5757
public void testDepartGetUsers() throws WxErrorException {
58-
List<WxCpUser> users = wxCpService.departGetUsers(1, true, 0);
58+
List<WxCpUser> users = this.wxCpService.departGetUsers(1, true, 0);
5959
Assert.assertNotEquals(users.size(), 0);
6060
}
6161

6262
@Test(dependsOnMethods = "testDepartGetUsers")
6363
public void testUserDelete() throws WxErrorException {
64-
wxCpService.userDelete("some.woman");
64+
this.wxCpService.userDelete("some.woman");
6565
}
6666
}

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxMenuAPITest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ public class WxMenuAPITest {
2424

2525
@Test(dataProvider = "menu")
2626
public void testCreateMenu(WxMenu wxMenu) throws WxErrorException {
27-
wxService.menuCreate(wxMenu);
27+
this.wxService.menuCreate(wxMenu);
2828
}
2929

3030
@Test(dependsOnMethods = {"testCreateMenu"})
3131
public void testGetMenu() throws WxErrorException {
32-
Assert.assertNotNull(wxService.menuGet());
32+
Assert.assertNotNull(this.wxService.menuGet());
3333
}
3434

3535
@Test(dependsOnMethods = {"testGetMenu"})
3636
public void testDeleteMenu() throws WxErrorException {
37-
wxService.menuDelete();
37+
this.wxService.menuDelete();
3838
}
3939

4040
@DataProvider(name = "menu")

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/demo/WxCpDemoInMemoryConfigStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public static WxCpDemoInMemoryConfigStorage fromXml(InputStream is) {
2121

2222
@Override
2323
public String toString() {
24-
return "SimpleWxConfigProvider [appidOrCorpid=" + corpId + ", corpSecret=" + corpSecret + ", accessToken=" + accessToken
25-
+ ", expiresTime=" + expiresTime + ", token=" + token + ", aesKey=" + aesKey + "]";
24+
return "SimpleWxConfigProvider [appidOrCorpid=" + this.corpId + ", corpSecret=" + this.corpSecret + ", accessToken=" + this.accessToken
25+
+ ", expiresTime=" + this.expiresTime + ", token=" + this.token + ", aesKey=" + this.aesKey + "]";
2626
}
2727

2828
}

0 commit comments

Comments
 (0)