summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
index 82c3cf331..5556d0310 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
@@ -85,8 +85,8 @@ public class ApexRestClientProducer implements ApexEventProducer {
restProducerProperties.setHttpMethod(RestClientCarrierTechnologyParameters.DEFAULT_PRODUCER_HTTP_METHOD);
}
- if (!restProducerProperties.getHttpMethod().equalsIgnoreCase("POST")
- && !restProducerProperties.getHttpMethod().equalsIgnoreCase("PUT")) {
+ if (!"POST".equalsIgnoreCase(restProducerProperties.getHttpMethod())
+ && !"PUT".equalsIgnoreCase(restProducerProperties.getHttpMethod())) {
final String errorMessage = "specified HTTP method of \"" + restProducerProperties.getHttpMethod()
+ "\" is invalid, only HTTP methods \"POST\" and \"PUT\" are supproted "
+ "for event sending on REST client producer (" + this.name + ")";
@@ -183,7 +183,7 @@ public class ApexRestClientProducer implements ApexEventProducer {
*/
public Response sendEventAsRestRequest(final String event) {
// We have already checked that it is a PUT or POST request
- if (restProducerProperties.getHttpMethod().equalsIgnoreCase("POST")) {
+ if ("POST".equalsIgnoreCase(restProducerProperties.getHttpMethod())) {
return client.target(restProducerProperties.getUrl()).request("application/json").post(Entity.json(event));
} else {
return client.target(restProducerProperties.getUrl()).request("application/json").put(Entity.json(event));