aboutsummaryrefslogtreecommitdiffstats
path: root/common-app-api/src/test/java
diff options
context:
space:
mode:
authorisaac.manuelraj <isaac.manuelraj@huawei.com>2018-10-29 12:19:16 +0530
committerMichael Lando <michael.lando@intl.att.com>2018-11-01 03:44:14 +0000
commitdb7afc1623e7d4cd88d1279375209239c4841fc4 (patch)
tree5f72a6d61401ec6cff28932bec20f1abc046e764 /common-app-api/src/test/java
parent461e964344d01e245464980b6ace12e4b28569e6 (diff)
Add test case for RestUtil.java
Add test case for RestUtil.java class. Issue-ID: SDC-1774 Change-Id: Ic048bcbac46514d08ec2328b0ab488fbdc606e0a Signed-off-by: isaac.manuelraj <isaac.manuelraj@huawei.com>
Diffstat (limited to 'common-app-api/src/test/java')
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/common/http/client/api/RestUtilsTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/http/client/api/RestUtilsTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/http/client/api/RestUtilsTest.java
new file mode 100644
index 0000000000..816a057fa2
--- /dev/null
+++ b/common-app-api/src/test/java/org/openecomp/sdc/common/http/client/api/RestUtilsTest.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.common.http.client.api;
+
+import org.apache.http.HttpHeaders;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import org.openecomp.sdc.common.http.client.api.*;
+
+import java.util.Properties;
+
+public class RestUtilsTest {
+
+ @Test
+ public void addBasicAuthHeader() {
+ Properties headers = new Properties();
+ RestUtils restutil = new RestUtils();
+ restutil.addBasicAuthHeader(headers,"uname","passwd");
+ assertEquals(headers.getProperty(HttpHeaders.AUTHORIZATION),"Basic dW5hbWU6cGFzc3dk");
+ }
+} \ No newline at end of file