()
| 348 | |
| 349 | // serializeToJSONPBytes |
| 350 | @Test |
| 351 | public void serializeToJSONPBytes() throws Exception { |
| 352 | HashMap<String, String> map = new HashMap<String, String>(); |
| 353 | map.put("utf", "aériennes"); |
| 354 | map.put("ascii", "aariennes"); |
| 355 | byte[] raw = JSON.serializeToJSONPBytes("dummycb", map); |
| 356 | assertNotNull(raw); |
| 357 | String json = new String(raw, "UTF8"); |
| 358 | assertTrue(json.matches("dummycb\\(.*[{,]\"ascii\":\"aariennes\"[,}].*\\)")); |
| 359 | } |
| 360 | |
| 361 | @Test (expected = IllegalArgumentException.class) |
| 362 | public void serializeToJSONPBytesNullData() throws Exception { |
nothing calls this directly
no test coverage detected