File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
lodash-plugin/src/test/java/com/github/underscore/lodash Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1314,6 +1314,20 @@ public void toJsonFromXml() {
13141314 $ .toJson ((Map <String , Object >) $ .fromXml (xml )));
13151315 }
13161316
1317+ @ SuppressWarnings ("unchecked" )
1318+ @ Test
1319+ public void toXmlFromJson () {
1320+ final String json = "{\n "
1321+ + " \" root\" : {\n "
1322+ + " \" FirstItem\" : \" 1\" ,\n "
1323+ + " \" SecondItem\" : \" 2\" \n "
1324+ + " }\n "
1325+ + "}" ;
1326+ assertEquals ("<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <root>\n "
1327+ + " <FirstItem>1</FirstItem>\n <SecondItem>2</SecondItem>\n </root>" ,
1328+ $ .toXml ((Map <String , Object >) $ .fromJson (json )));
1329+ }
1330+
13171331 @ SuppressWarnings ("unchecked" )
13181332 @ Test
13191333 public void toXml () {
You can’t perform that action at this time.
0 commit comments