From 45e3d3ae1cc5a4c29526da4f4cb6096e1b6d7d4f Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 29 May 2020 16:32:57 -0400 Subject: Use "coder" to serialize Actor requests Modified the Actors to use the "coder" to serialize requests instead of defaulting to the HttpClient serialization provider. Decided to just pretty-print the requests since that can be used for both logging and transmission, which avoids serializing the request twice. Issue-ID: POLICY-2601 Change-Id: I190ed19dd852a1aa66156b358cbc97c3b121af1f Signed-off-by: Jim Hahn --- .../actorserviceprovider/impl/HttpOperationTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'models-interactions/model-actors/actorServiceProvider/src/test') diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java index eb1aa880f..9ac88f488 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java @@ -532,14 +532,15 @@ public class HttpOperationTest { MyRequest request = new MyRequest(); - Entity entity = Entity.entity(request, MediaType.APPLICATION_JSON); - Map headers = makeHeaders(); headers.put("Accept", MediaType.APPLICATION_JSON); String url = getUrl(); - logMessage(EventType.OUT, CommInfrastructure.REST, url, request); + String strRequest = prettyPrint(request); + logMessage(EventType.OUT, CommInfrastructure.REST, url, strRequest); + + Entity entity = Entity.entity(strRequest, MediaType.APPLICATION_JSON); // @formatter:off return handleResponse(outcome, url, @@ -558,14 +559,15 @@ public class HttpOperationTest { MyRequest request = new MyRequest(); - Entity entity = Entity.entity(request, MediaType.APPLICATION_JSON); - Map headers = makeHeaders(); headers.put("Accept", MediaType.APPLICATION_JSON); String url = getUrl(); - logMessage(EventType.OUT, CommInfrastructure.REST, url, request); + String strRequest = prettyPrint(request); + logMessage(EventType.OUT, CommInfrastructure.REST, url, strRequest); + + Entity entity = Entity.entity(strRequest, MediaType.APPLICATION_JSON); // @formatter:off return handleResponse(outcome, url, -- cgit 1.2.3-korg