Tests fix after Migration to REST
authorDmytro Logachev <d.logachev@samsung.com>
Tue, 25 Jul 2017 15:23:15 +0000 (18:23 +0300)
committerDmytro Logachev <d.logachev@samsung.com>
Tue, 25 Jul 2017 15:23:15 +0000 (18:23 +0300)
device_core/utest/test_iot_dev_manager.cpp
device_core/utest/test_rest.cpp

index 8d0cde0..fbc0196 100644 (file)
@@ -26,8 +26,8 @@ public:
     {
         ASSERT_EQ(EC_OK, NM_init(&ctx));
 
-        std::string login("login");
-        std::string password("password");
+        std::string login("admin@samsung.com");
+        std::string password("111111");
         ASSERT_EQ(EC_OK, NM_signIn(ctx, login.c_str(), password.c_str()));
     }
 
index a7844fe..086155e 100644 (file)
@@ -3,6 +3,7 @@
 #include "rest_request.h"
 #include "restservice.h"
 #include <stdexcept>
+#include "nmexceptions.h"
 
 using namespace NetworkManager;
 
@@ -44,11 +45,9 @@ TEST(test_REST, test_getAuthCode)
 {
     try
     {
-        RestService service("http://106.125.46.74:8080/dsm/restapi");
-        // TODO: replace [login = "client" with login = "admin@samsung.com" and pass = "secret" with pass = "111111"]
-        // when server will be fixed
-        std::string login = "client";
-        std::string pass = "secret";
+        RestService service("http://106.125.46.74:8080/dsm/restapi/");
+        std::string login = "admin@samsung.com";
+        std::string pass = "111111";
 
         std::string code = service.getAuthCode(login, pass);
         ASSERT_FALSE(code.empty());
@@ -69,7 +68,7 @@ TEST(test_REST, test_get_wrong_address)
     RestRequest::QueryParameters params = {{"user", "anon"}, {"id", "3"}};
     std::string response;
 
-    ASSERT_THROW(request.get(params, "/", response), std::runtime_error);
+    ASSERT_THROW(request.get(params, "/", response), NMexception);
 }
 
 TEST(test_REST, test_RestRequest_addHeader_empty)