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 --- .../org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'models-interactions/model-actors/actor.sdnc/src/test') diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java index 921694269..5cc09560f 100644 --- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java +++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java @@ -36,6 +36,7 @@ import java.util.concurrent.TimeoutException; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; +import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.controlloop.actor.test.BasicHttpOperation; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; @@ -114,7 +115,7 @@ public abstract class BasicSdncOperation extends BasicHttpOperation * @return the request that was posted */ protected SdncRequest verifyOperation(SdncOperation operation) - throws InterruptedException, ExecutionException, TimeoutException { + throws InterruptedException, ExecutionException, TimeoutException, CoderException { CompletableFuture future2 = operation.start(); executor.runAll(100); @@ -132,7 +133,9 @@ public abstract class BasicSdncOperation extends BasicHttpOperation assertNotNull(outcome.getSubRequestId()); - return requestCaptor.getValue().getEntity(); + String reqText = requestCaptor.getValue().getEntity(); + + return coder.decode(reqText, SdncRequest.class); } /** -- cgit 1.2.3-korg