From 77a032f176183287746858d8eb57a6062286d327 Mon Sep 17 00:00:00 2001 From: Shiwei Tian Date: Mon, 9 Apr 2018 18:52:50 +0800 Subject: fix https bug Issue-ID: HOLMES-104 Change-Id: Ia2b37ffde95de4d5ea8f99340e1c9fc5b0063c07 Signed-off-by: Shiwei Tian --- .../main/java/org/onap/holmes/common/utils/HttpsUtils.java | 8 -------- .../java/org/onap/holmes/common/utils/HttpsUtilsTest.java | 12 ------------ 2 files changed, 20 deletions(-) (limited to 'holmes-actions') diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java index 29a1c91..48ed0ae 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java @@ -183,15 +183,7 @@ public class HttpsUtils { try { httpResponse = httpClient.execute(httpRequest); } catch (Exception e) { - e.printStackTrace(); throw new CorrelationException("Failed to get data from server" ,e); - } finally { - if (httpRequest != null) { - httpRequest.releaseConnection(); - } - if (httpClient != null) { - httpClient.close(); - } } return httpResponse; } diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/HttpsUtilsTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/HttpsUtilsTest.java index c47542b..087c1d3 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/HttpsUtilsTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/utils/HttpsUtilsTest.java @@ -90,9 +90,6 @@ public class HttpsUtilsTest { HttpEntity responseEntity = new StringEntity("Test"); EasyMock.expect(response.getEntity()).andReturn(responseEntity); - httpClient.close(); - EasyMock.expectLastCall(); - PowerMock.replayAll(); @@ -135,9 +132,6 @@ public class HttpsUtilsTest { HttpEntity responseEntity = new StringEntity("Test"); EasyMock.expect(response.getEntity()).andReturn(responseEntity); - httpClient.close(); - EasyMock.expectLastCall(); - PowerMock.replayAll(); @@ -182,9 +176,6 @@ public class HttpsUtilsTest { HttpEntity responseEntity = new StringEntity("Test"); EasyMock.expect(response.getEntity()).andReturn(responseEntity); - httpClient.close(); - EasyMock.expectLastCall(); - PowerMock.replayAll(); @@ -230,9 +221,6 @@ public class HttpsUtilsTest { HttpEntity responseEntity = new StringEntity("Test"); EasyMock.expect(response.getEntity()).andReturn(responseEntity); - httpClient.close(); - EasyMock.expectLastCall(); - PowerMock.replayAll(); -- cgit 1.2.3-korg