From 8279af376b435e1d7dd118a1955c5681edf3b847 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Wed, 29 Aug 2018 07:58:53 -0400 Subject: Fix remaining checkstyle Lots of formatting, missing javadoc, distance from use, imports must be explicit, ordering of methods. Fixed some abbreviation problems in classes and renamed JUnit tests to fix this. Issue-ID: POLICY-883 Change-Id: I8494f63d88d63c0232aca97f7bcc848816228fb1 Signed-off-by: Pamela Dragosh --- .../java/org/onap/policy/rest/RESTManager.java | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'controlloop/common/model-impl/rest/src/main') diff --git a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java index 52ce13ef9..39e0d8a7f 100644 --- a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java +++ b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java @@ -51,6 +51,17 @@ public class RESTManager { } } + /** + * Perform REST Post. + * + * @param url the url + * @param username the user name + * @param password the password + * @param headers any headers + * @param contentType what the content type is + * @param body body to send + * @return the response status code and the body + */ public Pair post(String url, String username, String password, Map headers, String contentType, String body) { @@ -77,7 +88,7 @@ public class RESTManager { } } post.addHeader("Content-Type", contentType); - if(authHeader != null) { + if (authHeader != null) { post.setHeader(HttpHeaders.AUTHORIZATION, authHeader); } @@ -107,6 +118,15 @@ public class RESTManager { } } + /** + * Do a REST get. + * + * @param url URL + * @param username user name + * @param password password + * @param headers any headers to add + * @return a Pair for the response status and the body + */ public Pair get(String url, String username, String password, Map headers) { @@ -124,7 +144,7 @@ public class RESTManager { get.addHeader(entry.getKey(), headers.get(entry.getKey())); } } - if(authHeader != null) { + if (authHeader != null) { get.setHeader(HttpHeaders.AUTHORIZATION, authHeader); } -- cgit 1.2.3-korg