mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
规范Test中POJO的使用;
This commit is contained in:
parent
aba35cc6c2
commit
9417bbee2e
@ -2,6 +2,7 @@ package cn.hutool.core.stream;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.BooleanUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Tolerate;
|
import lombok.experimental.Tolerate;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
@ -476,7 +477,7 @@ public class EasyStreamTest {
|
|||||||
Student.builder().id(8L).name("jobob").parentId(5L).build()
|
Student.builder().id(8L).name("jobob").parentId(5L).build()
|
||||||
)
|
)
|
||||||
// just 4 lambda ,top by condition
|
// just 4 lambda ,top by condition
|
||||||
.toTree(Student::getId, Student::getParentId, Student::setChildren, Student::isMatchParent);
|
.toTree(Student::getId, Student::getParentId, Student::setChildren, Student::getMatchParent);
|
||||||
Assert.assertEquals(asList(
|
Assert.assertEquals(asList(
|
||||||
Student.builder().id(1L).name("dromara").matchParent(true)
|
Student.builder().id(1L).name("dromara").matchParent(true)
|
||||||
.children(asList(Student.builder().id(3L).name("hutool").parentId(1L)
|
.children(asList(Student.builder().id(3L).name("hutool").parentId(1L)
|
||||||
@ -540,12 +541,16 @@ public class EasyStreamTest {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
private List<Student> children;
|
private List<Student> children;
|
||||||
private boolean matchParent;
|
private Boolean matchParent;
|
||||||
|
|
||||||
@Tolerate
|
@Tolerate
|
||||||
public Student() {
|
public Student() {
|
||||||
// this is an accessible parameterless constructor.
|
// this is an accessible parameterless constructor.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getMatchParent() {
|
||||||
|
return BooleanUtil.isTrue(matchParent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user