From 7d6e1ae492d91b74c6db995f42ef665d9e375245 Mon Sep 17 00:00:00 2001 From: Michal Kabaj Date: Thu, 15 Nov 2018 13:48:36 +0100 Subject: Add unit tests for ExternalAPIUtil -Add unit tests for ExternalAPIUtil -Add dependency injection via constructor -Add factory for creating ExternalAPIUtil and RESTClient Change-Id: Ied89afa3612de8d51424c95239341a57387ad94f Issue-ID: SO-1195 Signed-off-by: Michal Kabaj --- .../java/org/onap/so/client/HttpClientFactory.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 common/src/main/java/org/onap/so/client/HttpClientFactory.java (limited to 'common/src/main') diff --git a/common/src/main/java/org/onap/so/client/HttpClientFactory.java b/common/src/main/java/org/onap/so/client/HttpClientFactory.java new file mode 100644 index 0000000000..9705d7d0c4 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/HttpClientFactory.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.client; + +import java.net.URL; +import org.onap.so.utils.TargetEntity; + +public class HttpClientFactory { + + public HttpClient create(URL host, String contentType, TargetEntity targetEntity) { + return new HttpClient(host, contentType, targetEntity); + } +} -- cgit 1.2.3-korg