mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
50b67ecdfe
commit
842f89bce3
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.hutool.json;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class IssueI90ADXTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试只有getter方法时是否可以解析
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void parseTest() {
|
||||||
|
final TestBean testBean = new TestBean();
|
||||||
|
testBean.name = "aaaa";
|
||||||
|
|
||||||
|
final JSONObject json = JSONUtil.parseObj(testBean);
|
||||||
|
Assertions.assertEquals("{\"name\":\"aaaa\"}", json.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
static class TestBean{
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user