Skip to content

Commit d9515ef

Browse files
Copilotbinarywang
andcommitted
修复:测试类中的类型不匹配和deprecated方法
Co-authored-by: binarywang <[email protected]>
1 parent e0e51f9 commit d9515ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/tp/service/impl/WxCpTpCustomizedServiceImplTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class WxCpTpCustomizedServiceImplTest {
3939
*/
4040
@BeforeClass
4141
public void setUp() {
42-
MockitoAnnotations.initMocks(this);
42+
MockitoAnnotations.openMocks(this);
4343
configStorage = new WxCpTpDefaultConfigImpl();
4444
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
4545
wxCpTpCustomizedService = new WxCpTpCustomizedServiceImpl(wxCpTpService);
@@ -75,7 +75,7 @@ public void testGetTemplateList() throws WxErrorException {
7575
final WxCpTpTemplateList templateList = wxCpTpCustomizedService.getTemplateList();
7676

7777
assertNotNull(templateList);
78-
assertEquals(templateList.getErrcode(), Integer.valueOf(0));
78+
assertEquals(templateList.getErrcode(), Long.valueOf(0));
7979
assertNotNull(templateList.getTemplateList());
8080
assertEquals(templateList.getTemplateList().size(), 1);
8181
assertEquals(templateList.getTemplateList().get(0).getTemplateId(), "tpl001");
@@ -137,7 +137,7 @@ public void testGetCustomizedAppDetail() throws WxErrorException {
137137
final WxCpTpCustomizedAppDetail appDetail = wxCpTpCustomizedService.getCustomizedAppDetail(authCorpId, agentId);
138138

139139
assertNotNull(appDetail);
140-
assertEquals(appDetail.getErrcode(), Integer.valueOf(0));
140+
assertEquals(appDetail.getErrcode(), Long.valueOf(0));
141141
assertEquals(appDetail.getAuthCorpId(), authCorpId);
142142
assertEquals(appDetail.getAuthCorpName(), "测试企业");
143143
assertNotNull(appDetail.getCustomizedAppList());
@@ -172,7 +172,7 @@ public void testGetCustomizedAppDetailWithoutAgentId() throws WxErrorException {
172172
final WxCpTpCustomizedAppDetail appDetail = wxCpTpCustomizedService.getCustomizedAppDetail(authCorpId, null);
173173

174174
assertNotNull(appDetail);
175-
assertEquals(appDetail.getErrcode(), Integer.valueOf(0));
175+
assertEquals(appDetail.getErrcode(), Long.valueOf(0));
176176
assertEquals(appDetail.getAuthCorpId(), authCorpId);
177177
}
178178
}

0 commit comments

Comments
 (0)