()
| 287 | |
| 288 | // serializeToString |
| 289 | @Test |
| 290 | public void serializeToString() throws Exception { |
| 291 | HashMap<String, String> map = new HashMap<String, String>(); |
| 292 | map.put("utf", "aériennes"); |
| 293 | map.put("ascii", "aariennes"); |
| 294 | String json = JSON.serializeToString(map); |
| 295 | assertNotNull(json); |
| 296 | assertFalse(json.isEmpty()); |
| 297 | assertTrue(json.matches(".*[{,]\"ascii\":\"aariennes\"[,}].*")); |
| 298 | } |
| 299 | |
| 300 | @Test (expected = IllegalArgumentException.class) |
| 301 | public void serializeToStringNull() throws Exception { |
nothing calls this directly
no test coverage detected