This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-hessian2.git


The following commit(s) were added to refs/heads/master by this push:
     new 82fbc49  add unit test for #272
     new 9d0f6e0  Merge pull request #273 from wongoo/fix-272
82fbc49 is described below

commit 82fbc492cfb2b3ca2931c4523cda34c389a6385d
Author: wangoo <[email protected]>
AuthorDate: Wed Jul 14 17:03:21 2021 +0800

    add unit test for #272
---
 string_test.go                                       | 5 +++++
 test_hessian/src/main/java/test/TestCustomReply.java | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/string_test.go b/string_test.go
index dbac7c5..5ef0f82 100644
--- a/string_test.go
+++ b/string_test.go
@@ -146,6 +146,11 @@ func TestString(t *testing.T) {
        testDecodeFramework(t, "replyString_null", nil)
 }
 
+func TestDecodeJsonString(t *testing.T) {
+       jsonString := 
`{"params":{"fromAccid":"23495382","msgType":100,"msgId":"148ef1b2-808d-48f2-b268-7a1018a27bdb","attach":"{\"accid\":\"23495382\",\"classRoomFlag\":50685,\"msgId\":\"599645021431398400\",\"msgType\":\"100\",\"nickname\":\"橙子������\"}","roomid":413256699},"url":"https://api.netease.im/nimserver/chatroom/sendMsg.action"}`
+       testDecodeFramework(t, "customReplyJsonString", jsonString)
+}
+
 func TestStringEncode(t *testing.T) {
        s0 := ""
        s1 := "0"
diff --git a/test_hessian/src/main/java/test/TestCustomReply.java 
b/test_hessian/src/main/java/test/TestCustomReply.java
index f367be1..3ae19de 100644
--- a/test_hessian/src/main/java/test/TestCustomReply.java
+++ b/test_hessian/src/main/java/test/TestCustomReply.java
@@ -86,6 +86,12 @@ public class TestCustomReply {
         typeMap.put(Date[].class, "[date");
     }
 
+    public void customReplyJsonString() throws Exception {
+        String s = 
"{\"params\":{\"fromAccid\":\"23495382\",\"msgType\":100,\"msgId\":\"148ef1b2-808d-48f2-b268-7a1018a27bdb\",\"attach\":\"{\\\"accid\\\":\\\"23495382\\\",\\\"classRoomFlag\\\":50685,\\\"msgId\\\":\\\"599645021431398400\\\",\\\"msgType\\\":\\\"100\\\",\\\"nickname\\\":\\\"橙子������\\\"}\",\"roomid\":413256699},\"url\":\"https://api.netease.im/nimserver/chatroom/sendMsg.action\"}";;
+        output.writeObject(s);
+        output.flush();
+    }
+
     public void customReplyTypedFixedListHasNull() throws Exception {
         Object[] o = new Object[]{new A0(), new A1(), null};
         output.writeObject(o);

Reply via email to