From: Dmytro Logachev Date: Tue, 25 Jul 2017 15:23:15 +0000 (+0300) Subject: Tests fix after Migration to REST X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29660648cbcda6b113f336c6973dbd8f48c353de;p=platform%2Fcore%2Fsecurity%2Fsuspicious-activity-monitor.git Tests fix after Migration to REST --- diff --git a/device_core/utest/test_iot_dev_manager.cpp b/device_core/utest/test_iot_dev_manager.cpp index 8d0cde0..fbc0196 100644 --- a/device_core/utest/test_iot_dev_manager.cpp +++ b/device_core/utest/test_iot_dev_manager.cpp @@ -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())); } diff --git a/device_core/utest/test_rest.cpp b/device_core/utest/test_rest.cpp index a7844fe..086155e 100644 --- a/device_core/utest/test_rest.cpp +++ b/device_core/utest/test_rest.cpp @@ -3,6 +3,7 @@ #include "rest_request.h" #include "restservice.h" #include +#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)