From 8f6cbbcca6378f6c980c03a4565f78dbd731f1a2 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 26 May 2020 17:44:44 -0400 Subject: Tests must specify serialization provider When GSON is made the default serialization provider, several junits break. Modified them to specify the GsonJackson provider, which is what the REST classes use in production. Issue-ID: POLICY-1526 Change-Id: If1bcb955d7411cf747a14a0bf1dc069b02e2f2ea Signed-off-by: Jim Hahn --- .../policy/drools/server/restful/RestLifecycleManagerTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'feature-lifecycle/src') diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java index d9e21b83..90492098 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java @@ -45,7 +45,9 @@ import org.onap.policy.common.endpoints.http.client.HttpClient; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; +import org.onap.policy.common.endpoints.http.server.YamlJacksonHandler; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; +import org.onap.policy.common.gson.JacksonHandler; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.network.NetworkUtil; @@ -110,7 +112,10 @@ public class RestLifecycleManagerTest { .build()); HttpServletServer server = - HttpServletServerFactoryInstance.getServerFactory().build("lifecycle", "localhost", 8765, "/", true, true); + HttpServletServerFactoryInstance.getServerFactory().build("lifecycle", "localhost", 8765, "/", + true, true); + server.setSerializationProvider( + String.join(",", JacksonHandler.class.getName(), YamlJacksonHandler.class.getName())); server.addServletClass("/*", RestLifecycleManager.class.getName()); server.waitedStart(5000L); -- cgit 1.2.3-korg