🎨 降级 Mockito 至 4.11.0 以兼容 Java 8
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -258,7 +258,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>5.14.2</version>
|
||||
<version>4.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -8,6 +8,7 @@ import me.chanjar.weixin.cp.config.impl.WxCpTpDefaultConfigImpl;
|
||||
import me.chanjar.weixin.cp.tp.service.WxCpTpCustomizedService;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -34,17 +35,29 @@ public class WxCpTpCustomizedServiceImplTest {
|
||||
|
||||
private WxCpTpCustomizedService wxCpTpCustomizedService;
|
||||
|
||||
private AutoCloseable mockitoAnnotations;
|
||||
|
||||
/**
|
||||
* Sets up.
|
||||
*/
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mockitoAnnotations = MockitoAnnotations.openMocks(this);
|
||||
configStorage = new WxCpTpDefaultConfigImpl();
|
||||
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
|
||||
wxCpTpCustomizedService = new WxCpTpCustomizedServiceImpl(wxCpTpService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tear down.
|
||||
*
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@AfterClass
|
||||
public void tearDown() throws Exception {
|
||||
mockitoAnnotations.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试获取应用模板列表
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ import me.chanjar.weixin.cp.config.impl.WxCpTpDefaultConfigImpl;
|
||||
import me.chanjar.weixin.cp.tp.service.WxCpTpEditionService;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -29,18 +30,31 @@ public class WxCpTpEditionServiceImplTest {
|
||||
|
||||
private WxCpTpEditionService wxCpTpEditionService;
|
||||
|
||||
private AutoCloseable mockitoAnnotations;
|
||||
|
||||
/**
|
||||
* Sets up.
|
||||
*/
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
mockitoAnnotations = MockitoAnnotations.openMocks(this);
|
||||
configStorage = new WxCpTpDefaultConfigImpl();
|
||||
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
|
||||
wxCpTpEditionService = new WxCpTpEditionServiceImpl(wxCpTpService);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tear down.
|
||||
*
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@AfterClass
|
||||
public void tearDown() throws Exception {
|
||||
mockitoAnnotations.close();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 延长试用期
|
||||
*
|
||||
|
||||
@@ -10,6 +10,7 @@ import me.chanjar.weixin.cp.config.impl.WxCpTpDefaultConfigImpl;
|
||||
import me.chanjar.weixin.cp.tp.service.WxCpTpLicenseService;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -36,18 +37,31 @@ public class WxCpTpLicenseServiceImplTest {
|
||||
|
||||
private WxCpTpLicenseService wxCpTpLicenseService;
|
||||
|
||||
private AutoCloseable mockitoAnnotations;
|
||||
|
||||
/**
|
||||
* Sets up.
|
||||
*/
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
mockitoAnnotations = MockitoAnnotations.openMocks(this);
|
||||
configStorage = new WxCpTpDefaultConfigImpl();
|
||||
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
|
||||
wxCpTpLicenseService = new WxCpTpLicenseServiceImpl(wxCpTpService);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tear down.
|
||||
*
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@AfterClass
|
||||
public void tearDown() throws Exception {
|
||||
mockitoAnnotations.close();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test crate new order.
|
||||
*
|
||||
|
||||
@@ -9,6 +9,7 @@ import me.chanjar.weixin.cp.tp.service.WxCpTpOrderService;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -35,18 +36,31 @@ public class WxCpTpOrderServiceImplTest {
|
||||
|
||||
private WxCpTpOrderService wxCpTpOrderService;
|
||||
|
||||
private AutoCloseable mockitoAnnotations;
|
||||
|
||||
/**
|
||||
* Sets up.
|
||||
*/
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
mockitoAnnotations = MockitoAnnotations.openMocks(this);
|
||||
configStorage = new WxCpTpDefaultConfigImpl();
|
||||
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
|
||||
wxCpTpOrderService = new WxCpTpOrderServiceImpl(wxCpTpService);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tear down.
|
||||
*
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@AfterClass
|
||||
public void tearDown() throws Exception {
|
||||
mockitoAnnotations.close();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
*
|
||||
|
||||
@@ -9,6 +9,7 @@ import me.chanjar.weixin.cp.config.impl.WxCpTpDefaultConfigImpl;
|
||||
import me.chanjar.weixin.cp.tp.service.WxCpTpTagService;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.testng.collections.CollectionUtils;
|
||||
@@ -36,17 +37,29 @@ public class WxCpTpTagServiceImplTest {
|
||||
|
||||
private WxCpTpTagService wxCpTpTagService;
|
||||
|
||||
private AutoCloseable mockitoAnnotations;
|
||||
|
||||
/**
|
||||
* Sets up.
|
||||
*/
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
mockitoAnnotations = MockitoAnnotations.openMocks(this);
|
||||
configStorage = new WxCpTpDefaultConfigImpl();
|
||||
when(wxCpTpService.getWxCpTpConfigStorage()).thenReturn(configStorage);
|
||||
wxCpTpTagService = new WxCpTpTagServiceImpl(wxCpTpService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tear down.
|
||||
*
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@AfterClass
|
||||
public void tearDown() throws Exception {
|
||||
mockitoAnnotations.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user