mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix 3504
This commit is contained in:
26
hutool-json/src/test/java/cn/hutool/json/Issue3504Test.java
Normal file
26
hutool-json/src/test/java/cn/hutool/json/Issue3504Test.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/3504
|
||||
*/
|
||||
public class Issue3504Test {
|
||||
|
||||
@Test
|
||||
public void test3504() {
|
||||
JsonBean jsonBean = new JsonBean();
|
||||
jsonBean.setName("test");
|
||||
jsonBean.setClasses(new Class[]{String.class});
|
||||
String huToolJsonStr = JSONUtil.toJsonStr(jsonBean);
|
||||
System.out.println("hutool json str-------" + huToolJsonStr);
|
||||
System.out.println(JSONUtil.toBean(huToolJsonStr, JsonBean.class));
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class JsonBean {
|
||||
private String name;
|
||||
private Class<?>[] classes;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user