1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00

Fix some todos, clean up some tests, improve coverage

This commit is contained in:
stleary 2015-12-30 00:00:58 -06:00
parent 4ddd6a19a7
commit fc318a765c
2 changed files with 58 additions and 31 deletions

View file

@ -143,6 +143,11 @@ public class CookieListTest {
"name5=myCookieValue5;"+
" name6=myCookieValue6;";
JSONObject jsonObject = CookieList.toJSONObject(cookieStr);
// exercise CookieList.toString()
String cookieListString = CookieList.toString(jsonObject);
// have to convert it back for validation
jsonObject = CookieList.toJSONObject(cookieListString);
// validate JSON content
Object doc = Configuration.defaultConfiguration().jsonProvider().parse(jsonObject.toString());
assertTrue("Expected 6 top level items", ((Map<?,?>)(JsonPath.read(doc, "$"))).size() == 6);