Fix case sensitive issue in msg body 25/49225/2
authorVictor Gao <victor.gao@huawei.com>
Sat, 26 May 2018 12:35:45 +0000 (20:35 +0800)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Wed, 30 May 2018 17:51:34 +0000 (17:51 +0000)
Use Gson().toJson function to convert the content string.

Change-Id: Id5480b9c9c5e8830f3c4606b551de6338ed88551
Issue-ID: HOLMES-135
Signed-off-by: Victor Gao <victor.gao@huawei.com>
holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java

index b3a9214..09bb013 100644 (file)
@@ -23,6 +23,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.onap.holmes.common.dmaap.entity.PolicyMsg;\r
 import org.onap.holmes.common.exception.CorrelationException;\r
 import com.alibaba.fastjson.JSON;\r
+import com.google.gson.Gson;\r
 import java.util.HashMap;\r
 import javax.ws.rs.core.MediaType;\r
 import lombok.Getter;\r
@@ -47,7 +48,8 @@ public class Publisher {
     public boolean publish(PolicyMsg msg) throws CorrelationException {\r
         String content;\r
         try {\r
-            content = JSON.toJSONString(msg);\r
+            //content = JSON.toJSONString(msg);\r
+               content = new Gson().toJson(msg);\r
         } catch (Exception e) {\r
             throw new CorrelationException("Failed to convert the message object to a json string.",\r
                     e);\r