diff options
Diffstat (limited to 'applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java')
-rw-r--r-- | applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java index 52ecd84b..0f0f7ea2 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java @@ -23,10 +23,7 @@ package org.onap.policy.pdp.xacml.application.common; import java.net.HttpURLConnection; import javax.ws.rs.core.Response; -import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; import org.onap.policy.common.endpoints.http.client.HttpClient; -import org.onap.policy.common.endpoints.http.client.HttpClientConfigException; -import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.slf4j.Logger; @@ -46,16 +43,10 @@ public class PolicyApiCaller { /** * Constructs the object. * - * @param params target specification - * @throws PolicyApiException if an error occurs + * @param httpClient API REST client */ - public PolicyApiCaller(BusTopicParams params) throws PolicyApiException { - try { - params.setClientName("policy-api"); - httpClient = makeClient(params); - } catch (HttpClientConfigException e) { - throw new PolicyApiException("connection to host: " + params.getHostname(), e); - } + public PolicyApiCaller(HttpClient httpClient) { + this.httpClient = httpClient; } /** @@ -87,10 +78,4 @@ public class PolicyApiCaller { throw new PolicyApiException(type.toString(), e); } } - - // these methods may be overridden by junit tests - - protected HttpClient makeClient(BusTopicParams busParams) throws HttpClientConfigException { - return HttpClientFactoryInstance.getClientFactory().build(busParams); - } } |