Send credentials to AAI 31/44031/6
authorJim Hahn <jrh3@att.com>
Sat, 21 Apr 2018 05:07:34 +0000 (01:07 -0400)
committerJim Hahn <jrh3@att.com>
Mon, 23 Apr 2018 14:47:33 +0000 (10:47 -0400)
commit49bccdce3e434e2e05d0f36ab5e4f2163184825b
tree2e2c27fad59671bb6fe0df23fba8688b7a090f14
parentd548b61bd5e657a4e2c47fb98da8c28e0a69cf42
Send credentials to AAI

link: http://www.baeldung.com/httpclient-4-basic-authentication
apache HttpClient does not send the credentials by default,
but instead waits for the server to issue a challenge before
sending them.  Modified RESTManager to construct and send the
Authorization header always instead of waiting for the
challenge.
Remove unused imports.
Also add Authorization header for POST request.
Change error message to match original error message when
username is null.
Preempt sonar issue.
Allow null user name, which indicates that the Authorization header
should not be sent.  Note: this only impacts the RESTManager class;
invoking classes (e.g., AaiManager) still enforce that the user name
exists in the properties.
Fix license dates in modified test code.

Change-Id: I3cb26e76562db746939631437775727809553390
Issue-ID: POLICY-754
Signed-off-by: Jim Hahn <jrh3@att.com>
controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java
controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java
controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java