mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
Convert change to ConvertUtil
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.json;
|
||||
|
||||
import org.dromara.hutool.core.bean.BeanUtil;
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.convert.ConvertUtil;
|
||||
import org.dromara.hutool.core.reflect.TypeReference;
|
||||
import lombok.Data;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -31,7 +31,7 @@ public class Issue1101Test {
|
||||
public void treeMapConvertTest(){
|
||||
final String json = "[{\"nodeName\":\"admin\",\"treeNodeId\":\"00010001_52c95b83-2083-4138-99fb-e6e21f0c1277\",\"sort\":0,\"type\":10,\"parentId\":\"00010001\",\"children\":[],\"id\":\"52c95b83-2083-4138-99fb-e6e21f0c1277\",\"status\":true},{\"nodeName\":\"test\",\"treeNodeId\":\"00010001_97054a82-f8ff-46a1-b76c-cbacf6d18045\",\"sort\":0,\"type\":10,\"parentId\":\"00010001\",\"children\":[],\"id\":\"97054a82-f8ff-46a1-b76c-cbacf6d18045\",\"status\":true}]";
|
||||
final JSONArray objects = JSONUtil.parseArray(json);
|
||||
final TreeSet<TreeNodeDto> convert = Convert.convert(new TypeReference<TreeSet<TreeNodeDto>>() {
|
||||
final TreeSet<TreeNodeDto> convert = ConvertUtil.convert(new TypeReference<TreeSet<TreeNodeDto>>() {
|
||||
}, objects);
|
||||
Assertions.assertEquals(2, convert.size());
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.json;
|
||||
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.convert.ConvertUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -82,7 +82,7 @@ public class IssueI49VZBTest {
|
||||
|
||||
@Test
|
||||
public void enumConvertTest(){
|
||||
final NBCloudKeyType type = Convert.toEnum(NBCloudKeyType.class, "snapKey");
|
||||
final NBCloudKeyType type = ConvertUtil.toEnum(NBCloudKeyType.class, "snapKey");
|
||||
Assertions.assertEquals(NBCloudKeyType.snapKey, type);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user