From a38e3fb6be80f815a6a06748f53d67c76e56f5c3 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Fri, 24 May 2019 13:51:36 +0200 Subject: JUnit tests for RestfulUtil Increased junit tests coverage according to Sonar analyses. Added missing tests for RestfulUtil. Issue-ID: SO-1692 Signed-off-by: Robert Bogacki Change-Id: I8744960c0ad3a36ca4c36e23867168bfda5cbd1d --- .../src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'adapters/mso-vfc-adapter/src/main/java/org/onap') diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java index 3419e6d20c..1e61d4deb2 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java @@ -79,6 +79,9 @@ public class RestfulUtil { @Autowired private Environment env; + @Autowired + private HttpClient client; + public String getMsbHost() { // MSB_IP will be set as ONAP_IP environment parameter in install flow. String msbIp = System.getenv().get(ONAP_IP); @@ -111,8 +114,6 @@ public class RestfulUtil { RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout) .setConnectionRequestTimeout(timeout).build(); - HttpClient client = HttpClientBuilder.create().build(); - if ("POST".equalsIgnoreCase(methodType)) { HttpPost httpPost = new HttpPost(msbUrl); httpPost.setConfig(requestConfig); -- cgit 1.2.3-korg