diff options
author | Michal Kabaj <michal.kabaj@nokia.com> | 2018-11-15 13:48:36 +0100 |
---|---|---|
committer | Michal Kabaj <michal.kabaj@nokia.com> | 2018-11-21 08:21:23 +0100 |
commit | 7d6e1ae492d91b74c6db995f42ef665d9e375245 (patch) | |
tree | 9535d0b17eb10d96b976004c08753ee4a4c01271 /common/src | |
parent | 4bae647a66bd08422ae2d9b8dec226434270eb5c (diff) |
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 <michal.kabaj@nokia.com>
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/main/java/org/onap/so/client/HttpClientFactory.java | 30 |
1 files changed, 30 insertions, 0 deletions
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); + } +} |