aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-01-21 12:42:10 -0500
committerJim Hahn <jrh3@att.com>2019-01-23 18:43:43 -0500
commit18914b033f67d25cc9377b2e381648a9e3184968 (patch)
tree973bfdd2a119c19d11e3770e2a4a82d898279284 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java
parent9f15e1987dc9fc6bb8196c415b817b3f1cf6bd5f (diff)
Add gson support to policy-endpoints
Added "provider" property to both http client and server builders. The provider defaults to jackson, to maintain backward compatibility until other policy code has been converted to gson. Removed commented item from pom. Added some comments and re-arranged a few pieces of code. Fixed a few typos and removed spacing at the end of some lines. Reordered imports. Added comments about limitations when using jersey-media-json-jackson. Address ridiculous checkstyle complaint. Support comma-separated list of serialization providers in jersey client. Disabled metainf discovery from jersey client and server so that the media-json dependencies could be re-instated in the pom. Address another ridiculous checkstyle complaint. Change-Id: Ic5a93b475d0ee9b435352b3516de6b865b00a86a Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java
new file mode 100644
index 00000000..5778eeeb
--- /dev/null
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoReqResp.java
@@ -0,0 +1,59 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP
+ * ================================================================================
+ * Copyright (C) 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.endpoints.http.server.test;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * "ECHO" request and response supporting serialization and de-serialization via
+ * both jackson and gson.
+ */
+public class RestEchoReqResp {
+ @JsonProperty("reqId")
+ @SerializedName("reqId")
+ private int requestId;
+
+ @JsonProperty("textValue")
+ @SerializedName("textValue")
+ private String text;
+
+ public int getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(int requestId) {
+ this.requestId = requestId;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ @Override
+ public String toString() {
+ return "RestEchoReqResp [requestId=" + requestId + ", text=" + text + "]";
+ }
+}