Add unit test for createBasicAuthHeader
The test verifies proper Basic Authentication
header generation and Base64 encoding/decoding
Tested: Unit test passes
Change-Id: I4c4ae7e30b1d781967208849a1919021e69a0b65
Signed-off-by: Kamran Hasan <khasan@nvidia.com>
diff --git a/test/http/utility_test.cpp b/test/http/utility_test.cpp
index 69887e8..689d634 100644
--- a/test/http/utility_test.cpp
+++ b/test/http/utility_test.cpp
@@ -105,6 +105,12 @@
EXPECT_EQ(data, decoded);
}
+TEST(Utility, CreateBasicAuthHeader)
+{
+ std::string authHeader = createBasicAuthHeader("username", "password");
+ EXPECT_EQ(authHeader, "Basic dXNlcm5hbWU6cGFzc3dvcmQ=");
+}
+
TEST(Utility, readUrlSegments)
{
boost::system::result<boost::urls::url_view> parsed =