aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources/src/test')
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/PserverTest.java7
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;
}