aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-08-02 15:28:00 -0400
committerJim Hahn <jrh3@att.com>2021-08-06 09:22:13 -0400
commit338cc2611738783285f9edebd259f7e6bff3973d (patch)
tree86518ff526b89e6f2d24fb7ed1882fe95dd5c8e1 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient
parent7438fe5a86a9fcfaf248ee32197b24d1badaecb3 (diff)
Use lombok in apex-pdp #3
Updated plugins thru plugins-persistence-jpa-eclipselink. Issue-ID: POLICY-3391 Change-Id: Id7a5aeca8bb45c7a089f0b9d49c9ecd4bc8a7178 Signed-off-by: Jim Hahn <jrh3@att.com>
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/ApexRestClientConsumer.java13
-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.java13
2 files changed, 8 insertions, 18 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/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
index 4f95c5636..db14006eb 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
@@ -3,6 +3,7 @@
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2021 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.
@@ -28,6 +29,8 @@ import java.util.regex.Pattern;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;
+import lombok.AccessLevel;
+import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
import org.onap.policy.apex.service.engine.event.ApexEventException;
@@ -58,6 +61,7 @@ public class ApexRestClientConsumer extends ApexPluginsEventConsumer {
private ApexEventReceiver eventReceiver;
// The HTTP client that makes a REST call to get an input event for Apex
+ @Setter(AccessLevel.PROTECTED)
private Client client;
// The pattern for filtering status code
@@ -176,13 +180,4 @@ public class ApexRestClientConsumer extends ApexPluginsEventConsumer {
}
}
}
-
- /**
- * Hook for unit test mocking of HTTP client.
- *
- * @param client the mocked client
- */
- protected void setClient(final Client client) {
- this.client = client;
- }
}
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 565587f62..cb6b55371 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
@@ -3,6 +3,7 @@
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2021 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.
@@ -29,6 +30,8 @@ import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
+import lombok.AccessLevel;
+import lombok.Setter;
import org.onap.policy.apex.service.engine.event.ApexEventException;
import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
import org.onap.policy.apex.service.engine.event.ApexPluginsEventProducer;
@@ -50,6 +53,7 @@ public class ApexRestClientProducer extends ApexPluginsEventProducer {
private static final Logger LOGGER = LoggerFactory.getLogger(ApexRestClientProducer.class);
// The HTTP client that makes a REST call with an event from Apex
+ @Setter(AccessLevel.PROTECTED)
private Client client;
// The REST carrier properties
@@ -157,13 +161,4 @@ public class ApexRestClientProducer extends ApexPluginsEventProducer {
.headers(restProducerProperties.getHttpHeadersAsMultivaluedMap()).put(Entity.json(event));
}
}
-
- /**
- * Hook for unit test mocking of HTTP client.
- *
- * @param client the mocked client
- */
- protected void setClient(final Client client) {
- this.client = client;
- }
}