summaryrefslogtreecommitdiffstats
path: root/examples/examples-onap-vcpe/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-02-17 16:07:33 -0500
committerJim Hahn <jrh3@att.com>2021-02-18 07:08:43 -0500
commit4e05982e36aa66b83fa0ee44b9631412442c3969 (patch)
treebb31502de569df19f1f6d1882f7b1bd89962982f /examples/examples-onap-vcpe/src/test
parentf0e8b6d9e32f55d464aed55c5bb79081bb16306f (diff)
Replace GsonXxxAdapters
The GsonXxxAdapters were removed from the models Serialization classes and replaced with type adapters from common. Modified the code to refer to the new adapters. Without this fix, examples-onap-vcpe will not compile. Could that be the cause of the apex-pdp standalone issue, POLICY-3066? Allow TypeAdapter in lieu of JsonSerializer/Deserializer adapters in config files. Note: examples-ona-bbs refers to the following, which were removed several releases ago (during the actor re-write?): - appclcm.util.Serialization$RequestAdapter & Serialization$ResponseAdapter Issue-ID: POLICY-2905 Change-Id: Ia57e0346343614cbd4a1cffd9c8393f207284244 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'examples/examples-onap-vcpe/src/test')
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AppcResponseCreator.java5
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVCpeSimEndpoint.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AppcResponseCreator.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AppcResponseCreator.java
index afbc3f280..e6d913b27 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AppcResponseCreator.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AppcResponseCreator.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +32,7 @@ import org.onap.policy.appclcm.AppcLcmBody;
import org.onap.policy.appclcm.AppcLcmDmaapWrapper;
import org.onap.policy.appclcm.AppcLcmInput;
import org.onap.policy.appclcm.AppcLcmOutput;
-import org.onap.policy.controlloop.util.Serialization;
+import org.onap.policy.common.gson.InstantAsMillisTypeAdapter;
/**
* Respond to an APPC request with a given delay.
@@ -47,7 +48,7 @@ public class AppcResponseCreator {
private final Timer appcTimer;
private static final Gson gson = new GsonBuilder()
- .registerTypeAdapter(Instant.class, new Serialization.GsonInstantAdapter()).setPrettyPrinting().create();
+ .registerTypeAdapter(Instant.class, new InstantAsMillisTypeAdapter()).setPrettyPrinting().create();
private static Integer nextResponseCode = 400;
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVCpeSimEndpoint.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVCpeSimEndpoint.java
index c275df18f..8b5d2ef88 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVCpeSimEndpoint.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVCpeSimEndpoint.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,8 +44,8 @@ import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
+import org.onap.policy.common.gson.InstantAsMillisTypeAdapter;
import org.onap.policy.common.utils.resources.TextFileUtils;
-import org.onap.policy.controlloop.util.Serialization;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -66,7 +67,7 @@ public class OnapVCpeSimEndpoint {
private static final Random randomDelayInc = new Random();
private static final Gson gson = new GsonBuilder()
- .registerTypeAdapter(Instant.class, new Serialization.GsonInstantAdapter()).setPrettyPrinting().create();
+ .registerTypeAdapter(Instant.class, new InstantAsMillisTypeAdapter()).setPrettyPrinting().create();
private static final AtomicInteger nextVnfId = new AtomicInteger(0);
private static Boolean nextControlLoopMessageIsOnset = true;