From af2e4018c92b0fb311f60dfe507335b12e2935a4 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 13 Sep 2019 12:14:25 -0400 Subject: Extract YamlJsonTranslator from StandardYamlCoder Refactored StandardYamlCoder, extracting a new class, YamlJsonTranslator, from it. This facilitates performing yaml translation when not using a standard "gson" coder. Added YamlJacksonHandler which supports YAML translation layered on top of a JacksonHandler instead of a GsonMessageBodyHandler. Also added junit tests to complete coverage of StandardCoder. Also added public APPLICATION_YAML to YamlMessageBodyHandler. Change-Id: Ia470fa194661fbf1aebeaf0f18b57f2a984cb64b Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn --- .../common/endpoints/http/server/test/RestServerTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java') diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java index cd40f012..519bbd1d 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java @@ -69,7 +69,6 @@ import org.onap.policy.common.utils.network.NetworkUtil; import org.powermock.reflect.Whitebox; public class RestServerTest { - private static final String APPLICATION_YAML = "application/yaml"; private static final String SERVER1 = "my-server-A"; private static final String SERVER2 = "my-server-B"; private static final String FACTORY_FIELD = "factory"; @@ -247,8 +246,9 @@ public class RestServerTest { public void testInvalidYaml() throws Exception { initRealParams(); - assertEquals(200, roundTrip(new StandardCoder().encode(new MyRequest()), APPLICATION_YAML)); - assertEquals(400, roundTrip("