mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add test
This commit is contained in:
parent
5baf3983b9
commit
d87bf2dfd9
@ -0,0 +1,26 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IssueI90ADXTest {
|
||||
|
||||
/**
|
||||
* 测试只有getter方法时是否可以解析
|
||||
*/
|
||||
@Test
|
||||
public void parseTest() {
|
||||
final TestBean testBean = new TestBean();
|
||||
testBean.name = "aaaa";
|
||||
|
||||
final JSONObject json = JSONUtil.parseObj(testBean);
|
||||
Assert.assertEquals("{\"name\":\"aaaa\"}", json.toString());
|
||||
}
|
||||
|
||||
@Getter
|
||||
static class TestBean{
|
||||
private String name;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user