Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Apr 8, 2023
1 parent 718dbed commit 2449775
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions core/src/test/java/com/alibaba/fastjson2/dubbo/DubboTest7.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package com.alibaba.fastjson2.dubbo;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONB;
import com.alibaba.fastjson2.JSONReader;
import com.alibaba.fastjson2.JSONWriter;
import com.alibaba.fastjson2.*;
import com.alibaba.fastjson2.util.DateUtils;
import org.junit.jupiter.api.Test;

import java.io.Serializable;
import java.util.Date;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class DubboTest7 {
static final JSONWriter.Feature[] writerFeatures = {
Expand Down Expand Up @@ -75,4 +73,16 @@ public static class Bean1
implements Serializable {
public String id;
}

@Test
public void test3() {
String str = JSONB.parseObject(
JSONB.toBytes(new RuntimeException(), writerFeatures),
String.class,
readerFeatures
);
assertNotNull(str);
JSONObject object = JSON.parseObject(str);
assertEquals("RuntimeException", object.get("@type"));
}
}

0 comments on commit 2449775

Please sign in to comment.