mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修正单元测试:ListUtilTest.pageTest 测试后,因PageUtil.firstPageNo值变成2导致其他测试用例运行失败。
This commit is contained in:
parent
f267e9e6b5
commit
7615d30f8b
@ -167,6 +167,9 @@ public class ListUtilTest {
|
|||||||
Assert.assertArrayEquals(new int[]{}, pageListData.get(0).stream().mapToInt(Integer::valueOf).toArray());
|
Assert.assertArrayEquals(new int[]{}, pageListData.get(0).stream().mapToInt(Integer::valueOf).toArray());
|
||||||
Assert.assertArrayEquals(new int[]{3, 4}, pageListData.get(1).stream().mapToInt(Integer::valueOf).toArray());
|
Assert.assertArrayEquals(new int[]{3, 4}, pageListData.get(1).stream().mapToInt(Integer::valueOf).toArray());
|
||||||
Assert.assertArrayEquals(new int[]{5}, pageListData.get(2).stream().mapToInt(Integer::valueOf).toArray());
|
Assert.assertArrayEquals(new int[]{5}, pageListData.get(2).stream().mapToInt(Integer::valueOf).toArray());
|
||||||
|
|
||||||
|
// 恢复默认值,避免影响其他测试用例
|
||||||
|
PageUtil.setFirstPageNo(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -5,14 +5,13 @@ import org.junit.Test;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页单元测试
|
* 分页单元测试
|
||||||
* @author Looly
|
|
||||||
*
|
*
|
||||||
|
* @author Looly
|
||||||
*/
|
*/
|
||||||
public class PageUtilTest {
|
public class PageUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void transToStartEndTest() {
|
public void transToStartEndTest() {
|
||||||
PageUtil.setFirstPageNo(0);
|
|
||||||
int[] startEnd1 = PageUtil.transToStartEnd(0, 10);
|
int[] startEnd1 = PageUtil.transToStartEnd(0, 10);
|
||||||
Assert.assertEquals(0, startEnd1[0]);
|
Assert.assertEquals(0, startEnd1[0]);
|
||||||
Assert.assertEquals(10, startEnd1[1]);
|
Assert.assertEquals(10, startEnd1[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user