From 8640a6e4b2d50cf2068207b1ddec965c07cec3aa Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 14 Mar 2019 14:24:14 +0000 Subject: Add support for TOSCA JSON Parsing Added a getter to allow the Gson object to be retrieved from a GSON message body handler, useful for testing. Moved the TextFileUtils utility class from APEX utilites to policy common utils Issue-ID: POLICY-1195 Change-Id: I7c8074e8177a90b292c6dfd6e7f0d352063818e7 Signed-off-by: liamfallon --- .../java/org/onap/policy/common/gson/GsonMessageBodyHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gson/src') diff --git a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java index fc8e23ef..9dad6db8 100644 --- a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java +++ b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java @@ -21,6 +21,7 @@ package org.onap.policy.common.gson; import com.google.gson.Gson; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -36,6 +37,9 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; + +import lombok.Getter; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +56,8 @@ public class GsonMessageBodyHandler implements MessageBodyReader, Messag /** * Object to be used to serialize and de-serialize. */ - private Gson gson; + @Getter + private final Gson gson; /** * Constructs the object, using a plain Gson object. -- cgit 1.2.3-korg