From cb8557e068ec89473dcb4d01a68e7dfd0a4644c5 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 15 Feb 2019 12:24:14 -0500 Subject: Test gson in policy-management Added jackson-like Gson annotations to policy-management classes. Also added tests to verify that the classes serialize the same with gson as with jackson. Removed some trailing spaces. Replaced tabs and adjusted spacing in json files. Removed trailing newlines. Updated license data per review comment. Fixed merge conflict. Added files that were inadvertently deleted. Change-Id: Ib546e70f9d9d83187a6a93ff5c634000c4d53da5 Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn --- .../policy/drools/controller/internal/MavenDroolsController.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java') diff --git a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java index 55352fe2..6a4b8f22 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java +++ b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java @@ -36,6 +36,8 @@ import org.kie.api.runtime.rule.FactHandle; import org.kie.api.runtime.rule.QueryResults; import org.kie.api.runtime.rule.QueryResultsRow; import org.onap.policy.common.endpoints.event.comm.TopicSink; +import org.onap.policy.common.gson.annotation.GsonJsonIgnore; +import org.onap.policy.common.gson.annotation.GsonJsonProperty; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.core.PolicyContainer; import org.onap.policy.drools.core.PolicySession; @@ -67,6 +69,7 @@ public class MavenDroolsController implements DroolsController { * Policy Container, the access object to the policy-core layer. */ @JsonIgnore + @GsonJsonIgnore protected final PolicyContainer policyContainer; /** @@ -646,12 +649,14 @@ public class MavenDroolsController implements DroolsController { } @JsonIgnore + @GsonJsonIgnore @Override public PolicyContainer getContainer() { return this.policyContainer; } @JsonProperty("sessions") + @GsonJsonProperty("sessions") @Override public List getSessionNames() { return getSessionNames(true); @@ -681,6 +686,7 @@ public class MavenDroolsController implements DroolsController { } @JsonProperty("sessionCoordinates") + @GsonJsonProperty("sessionCoordinates") @Override public List getCanonicalSessionNames() { return getSessionNames(false); -- cgit 1.2.3-korg