()
| 304 | |
| 305 | // serializeToBytes |
| 306 | @Test |
| 307 | public void serializeToBytes() throws Exception { |
| 308 | HashMap<String, String> map = new HashMap<String, String>(); |
| 309 | map.put("utf", "aériennes"); |
| 310 | map.put("ascii", "aariennes"); |
| 311 | byte[] raw = JSON.serializeToBytes(map); |
| 312 | assertNotNull(raw); |
| 313 | String json = new String(raw, "UTF8"); |
| 314 | assertTrue(json.matches(".*[{,]\"ascii\":\"aariennes\"[,}].*")); |
| 315 | } |
| 316 | |
| 317 | @Test (expected = IllegalArgumentException.class) |
| 318 | public void serializeToBytesNull() throws Exception { |
nothing calls this directly
no test coverage detected