diff options
author | Rodrigo Lima <rodrigo.lima@yoppworks.com> | 2020-06-05 14:02:15 -0400 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-06-10 08:23:11 +0000 |
commit | 8a0f58a005175959f5b56c0840ee9980f0d68c01 (patch) | |
tree | f6b0db3fa1cbcdb3f2b346a0c2157fc6e2a4c9dd /test-apis-ci/src/main | |
parent | a757067ec2b71e2c74cd0163f0c67bce402dcada (diff) |
Java 11 migration - 'test-apis-ci'
- Removed references to protected packages (sun.net.*)
Issue-ID: SDC-3037
Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com>
Change-Id: Ibbf25af390e624e15fb2bc8ea17777056fe5f3b5
Diffstat (limited to 'test-apis-ci/src/main')
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java index 0e81a7b2ac..ff01e7d999 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java @@ -31,9 +31,7 @@ import org.apache.http.impl.client.HttpClients; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sun.net.www.protocol.https.DefaultHostnameVerifier; -import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import java.io.*; import java.net.HttpURLConnection; @@ -256,12 +254,10 @@ public class HttpRequest { RestResponse restResponse = new RestResponse(); url = url.replaceAll("\\s", "%20"); - URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler()); + URL obj = new URL(null, url); HttpsURLConnection con = (HttpsURLConnection)obj.openConnection(); // optional default is GET con.setRequestMethod("GET"); - HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(); - con.setHostnameVerifier(hostnameVerifier); addHttpsRequestHeaders(headers, con); Boolean multiPart = false; if(headers.get(HttpHeaderEnum.ACCEPT.getValue()) != null) { @@ -295,10 +291,8 @@ public class HttpRequest { public RestResponse httpsSendPost(String url, String body, Map<String, String> headers) throws IOException { RestResponse restResponse = new RestResponse(); - URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler()); + URL obj = new URL(null, url); HttpsURLConnection con = (HttpsURLConnection)obj.openConnection(); - HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(); - con.setHostnameVerifier(hostnameVerifier); // add request method con.setRequestMethod("POST"); // add request headers @@ -336,10 +330,8 @@ public class HttpRequest { public RestResponse httpsSendByMethod(String url, String method, String body, Map<String, String> headers) throws IOException { RestResponse restResponse = new RestResponse(); - URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler()); + URL obj = new URL(null, url); HttpsURLConnection con = (HttpsURLConnection)obj.openConnection(); - HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(); - con.setHostnameVerifier(hostnameVerifier); // add request method con.setRequestMethod(method); // add request headers @@ -379,10 +371,8 @@ public class HttpRequest { public RestResponse httpsSendDelete(String url, Map<String, String> headers) throws IOException { RestResponse restResponse = new RestResponse(); - URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler()); + URL obj = new URL(null, url); HttpsURLConnection con = (HttpsURLConnection)obj.openConnection(); - HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(); - con.setHostnameVerifier(hostnameVerifier); // add request headers addHttpRequestHEaders(headers, con); |