From db7afc1623e7d4cd88d1279375209239c4841fc4 Mon Sep 17 00:00:00 2001 From: "isaac.manuelraj" Date: Mon, 29 Oct 2018 12:19:16 +0530 Subject: 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 --- .../sdc/common/http/client/api/RestUtilsTest.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common-app-api/src/test/java/org/openecomp/sdc/common/http/client/api/RestUtilsTest.java (limited to 'common-app-api') 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 -- cgit 1.2.3-korg