aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-01-15 13:28:16 -0600
committerJorge Hernandez <jorge.hernandez-herrero@att.com>2019-01-16 09:36:37 -0600
commit9f15e1987dc9fc6bb8196c415b817b3f1cf6bd5f (patch)
tree0aab018cb4a9186f7ae2efc2a88ba3200c58f6d4 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestEchoService.java
parent2a191bf0d0a5cb3beb436a025d2f4efa419bb354 (diff)
Add post and delete http client methods
Additional clean up for sonars have also been added for the classes that have been modified Issue-ID: POLICY-1367 Change-Id: Ie97d9057273e89850420a7c1b5b2d275709bdfd0 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@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.java23
1 files changed, 20 insertions, 3 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 56ed8933..5d9b14d3 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
@@ -1,8 +1,8 @@
/*-
* ============LICENSE_START=======================================================
- * policy-endpoints
+ * ONAP
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -23,7 +23,9 @@ 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;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -48,7 +50,22 @@ public class RestEchoService {
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "echoes back whatever received")
public String echoPut(@PathParam("word") String word, Object entity) {
- return word + ":" + entity.toString();
+ return "PUT:" + word + ":" + entity.toString();
}
+ @POST
+ @Path("{word}")
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "echoes back whatever received")
+ public String echoPost(@PathParam("word") String word, Object entity) {
+ return "POST:" + word + ":" + entity.toString();
+ }
+
+ @DELETE
+ @Path("{word}")
+ @Produces(MediaType.TEXT_PLAIN)
+ @ApiOperation(value = "echoes back whatever received")
+ public String echoDelete(@PathParam("word") String word) {
+ return "DELETE:" + word;
+ }
}