summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java')
-rw-r--r--src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java b/src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java
index def25fd..1246d71 100644
--- a/src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java
+++ b/src/main/java/org/onap/dcae/ci/utilities/BaseRestUtils.java
@@ -13,19 +13,19 @@ public class BaseRestUtils {
protected static final String acceptHeaderData = "application/json";
protected static final String contentTypeHeaderData = "application/json";
- public BaseRestUtils() {
+ BaseRestUtils() {
}
- protected static String getApiUrl(String path) {
+ static String getApiUrl(String path) {
Configuration configuration = SetupReport.getConfiguration();
- return String.format("%s:%s/sdc2/rest/v1/catalog/%s", configuration.getBeHost(), configuration.getBePort(), path);
+ return String.format("%s:%s/sdc2/rest/v1/catalog/%s", configuration.getSdcBeHost(), configuration.getSdcBePort(), path);
}
- protected static Map<String, String> prepareHeadersMap(String userId) {
+ private static Map<String, String> prepareHeadersMap(String userId) {
return prepareHeadersMap(userId, acceptHeaderData);
}
- protected static Map<String, String> prepareHeadersMap(String userId, String accept) {
+ private static Map<String, String> prepareHeadersMap(String userId, String accept) {
Map<String, String> headersMap = new HashMap<>();
headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
@@ -41,7 +41,7 @@ public class BaseRestUtils {
return headersMap;
}
- protected static RestResponse sendGet(String url, String userId) throws IOException {
+ static RestResponse sendGet(String url, String userId) throws IOException {
return sendGet(url, userId, (Map) null);
}
@@ -52,45 +52,41 @@ public class BaseRestUtils {
}
HttpRequest http = new HttpRequest();
- RestResponse getResourceResponse = http.httpSendGet(url, headersMap);
- return getResourceResponse;
+ return http.httpSendGet(url, headersMap);
}
- protected static RestResponse sendPut(String url, String userBodyJson, String userId, String cont) throws IOException {
+ static RestResponse sendPut(String url, String userBodyJson, String userId, String cont) throws IOException {
Map<String, String> headersMap = prepareHeadersMap(userId, cont);
HttpRequest http = new HttpRequest();
- RestResponse updateResourceResponse = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
- return updateResourceResponse;
+ return http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
}
- public static RestResponse sendPost(String url, String userBodyJson, String userId, String accept) throws IOException {
+ static RestResponse sendPost(String url, String userBodyJson, String userId, String accept) throws IOException {
return sendPost(url, userBodyJson, userId, accept, (Map) null);
}
- protected static RestResponse sendPost(String url, String userBodyJson, String userId, String accept, Map<String, String> additionalHeaders) throws IOException {
+ private static RestResponse sendPost(String url, String userBodyJson, String userId, String accept, Map<String, String> additionalHeaders) throws IOException {
Map<String, String> headersMap = prepareHeadersMap(userId, accept);
if (additionalHeaders != null) {
headersMap.putAll(additionalHeaders);
}
HttpRequest http = new HttpRequest();
- RestResponse postResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
- return postResourceResponse;
+ return http.httpSendPost(url, userBodyJson, headersMap);
}
- protected static RestResponse sendDelete(String url, String userId) throws IOException {
+ static RestResponse sendDelete(String url, String userId) throws IOException {
return sendDelete(url, userId, (Map) null);
}
- protected static RestResponse sendDelete(String url, String userId, Map<String, String> additionalHeaders) throws IOException {
+ private static RestResponse sendDelete(String url, String userId, Map<String, String> additionalHeaders) throws IOException {
Map<String, String> headersMap = prepareHeadersMap(userId);
if (additionalHeaders != null) {
headersMap.putAll(additionalHeaders);
}
HttpRequest http = new HttpRequest();
- RestResponse deleteResourceResponse = http.httpSendDelete(url, headersMap);
- return deleteResourceResponse;
+ return http.httpSendDelete(url, headersMap);
}
}