summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-12 13:10:58 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-12 13:10:58 +0000
commit8916bd3e643daeba1b09f6b04f831ac92962537d (patch)
tree5b7ea895d7b8c5b9367d2025d39c2964ae0032ed /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src
parentec485111483f1ffca0bc65d12ce461df3d595169 (diff)
parentf2ecd3282507c418ee7da5cd22c6e7613975d480 (diff)
Merge "fix sonar issues in restclient/restrequest"
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src')
-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.java15
1 files changed, 6 insertions, 9 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 822ac46a2..ea60e3915 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
@@ -23,10 +23,9 @@ package org.onap.policy.apex.plugins.event.carrier.restclient;
import java.util.EnumMap;
import java.util.Map;
+import java.util.Optional;
import java.util.Properties;
import java.util.Set;
-import java.util.Optional;
-import java.util.concurrent.atomic.AtomicReference;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
@@ -40,8 +39,6 @@ import org.onap.policy.apex.service.engine.event.PeeredReference;
import org.onap.policy.apex.service.engine.event.SynchronousEventCache;
import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters;
import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
-import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.common.parameters.ParameterException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -145,12 +142,12 @@ public class ApexRestClientProducer implements ApexEventProducer {
Set<String> names = restProducerProperties.getKeysFromUrl();
Set<String> inputProperty = executionProperties.stringPropertyNames();
- names.stream().map(key -> Optional.of(key)).forEach(op -> {
- op.filter(str -> inputProperty.contains(str))
+ names.stream().map(Optional::of).forEach(op ->
+ op.filter(inputProperty::contains)
.orElseThrow(() -> new ApexEventRuntimeException(
- "key\"" + op.get() + "\"specified on url \"" + restProducerProperties.getUrl() +
- "\"not found in execution properties passed by the current policy"));
- });
+ "key\"" + op.get() + "\"specified on url \"" + restProducerProperties.getUrl()
+ + "\"not found in execution properties passed by the current policy"))
+ );
untaggedUrl = names.stream().reduce(untaggedUrl,
(acc, str) -> acc.replace("{" + str + "}", (String) executionProperties.get(str)));