diff options
author | Jim Hahn <jrh3@att.com> | 2019-01-21 12:42:10 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-01-23 18:43:43 -0500 |
commit | 18914b033f67d25cc9377b2e381648a9e3184968 (patch) | |
tree | 973bfdd2a119c19d11e3770e2a4a82d898279284 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java | |
parent | 9f15e1987dc9fc6bb8196c415b817b3f1cf6bd5f (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/RestEchoService.java')
-rw-r--r-- | policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java index 5d9b14d3..9db1053f 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java @@ -22,7 +22,6 @@ package org.onap.policy.common.endpoints.http.server.test; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; - import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -31,6 +30,8 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; @Api(value = "echo") @@ -54,6 +55,14 @@ public class RestEchoService { } @POST + @Path("/full/request") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "echoes back the request structure", response = RestEchoReqResp.class) + public Response echoFullyPost(RestEchoReqResp reqResp) { + return Response.status(Status.OK).entity(reqResp).build(); + } + + @POST @Path("{word}") @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "echoes back whatever received") |