This commit is contained in:
Looly 2024-09-24 04:01:53 +08:00
parent d8a7b9b440
commit 702253aaf6

View File

@ -197,14 +197,12 @@ public class JSONArrayTest {
@Test
public void toListWithErrorTest() {
// Assertions.assertThrows(JSONException.class, ()->{
// });
final String json = "[['aaa',{'akey':'avalue','bkey':'bvalue'}]]";
final JSONArray ja = JSONUtil.parseArray(json);
final Object bean = ja.toBean(new TypeReference<List<List<KeyBean>>>() {});
Console.log(bean);
Assertions.assertThrows(JSONException.class, ()->{
final String json = "[['aaa',{'akey':'avalue','bkey':'bvalue'}]]";
final JSONArray ja = JSONUtil.parseArray(json);
final Object bean = ja.toBean(new TypeReference<List<List<KeyBean>>>() {});
Console.log(bean);
});
}
@Test