This commit is contained in:
Looly
2020-08-29 11:57:31 +08:00
parent 68ad664fec
commit dd1f89b555
3 changed files with 12 additions and 7 deletions

View File

@@ -5,10 +5,11 @@ import org.junit.Test;
public class XMLTest {
@SuppressWarnings("ConstantConditions")
@Test
public void toXmlTest(){
final JSONObject put = JSONUtil.createObj().put("aaa", "你好").put("键2", "test");
final JSONObject put = JSONUtil.createObj()
.set("aaa", "你好")
.set("键2", "test");
final String s = JSONUtil.toXmlStr(put);
Assert.assertEquals("<aaa>你好</aaa><键2>test</键2>", s);
}