File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
core/src/test/java/com/alibaba/fastjson2/dubbo Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11package com .alibaba .fastjson2 .dubbo ;
22
3- import com .alibaba .fastjson2 .JSON ;
4- import com .alibaba .fastjson2 .JSONB ;
5- import com .alibaba .fastjson2 .JSONReader ;
6- import com .alibaba .fastjson2 .JSONWriter ;
3+ import com .alibaba .fastjson2 .*;
74import com .alibaba .fastjson2 .util .DateUtils ;
85import org .junit .jupiter .api .Test ;
96
107import java .io .Serializable ;
118import java .util .Date ;
129
1310import static org .junit .jupiter .api .Assertions .assertEquals ;
11+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
1412
1513public class DubboTest7 {
1614 static final JSONWriter .Feature [] writerFeatures = {
@@ -75,4 +73,16 @@ public static class Bean1
7573 implements Serializable {
7674 public String id ;
7775 }
76+
77+ @ Test
78+ public void test3 () {
79+ String str = JSONB .parseObject (
80+ JSONB .toBytes (new RuntimeException (), writerFeatures ),
81+ String .class ,
82+ readerFeatures
83+ );
84+ assertNotNull (str );
85+ JSONObject object = JSON .parseObject (str );
86+ assertEquals ("RuntimeException" , object .get ("@type" ));
87+ }
7888}
You can’t perform that action at this time.
0 commit comments