diff options
author | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-04-11 00:00:39 -0400 |
---|---|---|
committer | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-04-11 00:16:29 -0400 |
commit | bf94b2907e5178b47500a5a388cdd56477ba9155 (patch) | |
tree | 99465dedb7230d14153ac1372f4f7cc29d237bee /aai-resources/src/test/java/org | |
parent | 453700a7dda49c63bbe2032796ec6bd2c2299e2f (diff) |
Fix the basic auth issue which got broken
with spring boot
Issue-ID: AAI-1019
Change-Id: I59c7351c381be07ae1be5abe6473d9c8614a0673
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/test/java/org')
-rw-r--r-- | aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java b/aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java index 7c4c3a7..2acc3c4 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java @@ -36,6 +36,8 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.client.RestTemplate; +import java.io.UnsupportedEncodingException; +import java.util.Base64; import java.util.Collections; import java.util.UUID; @@ -70,7 +72,7 @@ public class PserverTest { private String baseUrl; @Before - public void setup(){ + public void setup() throws UnsupportedEncodingException { HttpHeaders headers = new HttpHeaders(); @@ -80,6 +82,9 @@ public class PserverTest { headers.add("X-FromAppId", "JUNIT"); headers.add("X-TransactionId", "JUNIT"); + String authorization = Base64.getEncoder().encodeToString("AAI:AAI".getBytes("UTF-8")); + headers.add("Authorization", "Basic " + authorization); + httpEntity = new HttpEntity(headers); baseUrl = "https://localhost:" + randomPort; } |