File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/test/java/com/jsoniter Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com .jsoniter ;
2
2
3
3
import com .jsoniter .output .JsonStream ;
4
+ import com .jsoniter .spi .JsonException ;
4
5
import junit .framework .Test ;
5
6
import junit .framework .TestCase ;
6
7
7
8
import java .io .IOException ;
9
+ import java .util .Arrays ;
8
10
9
11
public class TestRecord extends TestCase {
10
12
@@ -15,7 +17,12 @@ record TestRecord1(long field1) {
15
17
public void test_record_error () throws IOException {
16
18
17
19
JsonIterator iter = JsonIterator .parse ("{ 'field1' : 1" .replace ('\'' , '"' ));
18
- iter .read (TestRecord1 .class );
20
+ try {
21
+ TestRecord1 rec = iter .read (TestRecord1 .class );
22
+ assertEquals (1 , rec .field1 );
23
+ }catch (JsonException e ) {
24
+ throw new JsonException ("no constructor for: class com.jsoniter.TestRecord" , e );
25
+ }
19
26
}
20
27
21
28
public void test_record_serialize (){
You can’t perform that action at this time.
0 commit comments