summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-11-22 15:04:30 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2019-11-22 15:04:30 -0500
commit8302575a3a598c65e2f4ae283fdf12fbebcb3092 (patch)
tree4c17e3e06bf42d9dda4e8cf7bec954d869b89765
parent2af0ed5047ffe3a80c8cbedbecb1fb11a34b6ebc (diff)
downloadsdl_core-8302575a3a598c65e2f4ae283fdf12fbebcb3092.tar.gz
Fix unit tests
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
index 636175c56f..d5e001b7ac 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
@@ -83,6 +83,8 @@ const hmi_apis::Common_Language::eType kHmiLanguage =
hmi_apis::Common_Language::EN_US;
const mobile_apis::Language::eType kMobileLanguage =
mobile_apis::Language::EN_US;
+const mobile_apis::HybridAppPreference::eType kHybridAppPreference =
+ mobile_apis::HybridAppPreference::INVALID_ENUM;
const std::string kMacAddress1 = "test_mac_address1";
const std::string kMacAddress2 = "test_mac_address2";
const std::string kAppId1 = "test_app1_id";
@@ -102,6 +104,7 @@ class RegisterAppInterfaceRequestTest
, app_name_("test_app_name_")
, app2_name_("test_app2_name_")
, lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , pending_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, mock_application_helper_(
application_manager_test::MockApplicationHelper::
application_helper_mock()) {
@@ -141,6 +144,9 @@ class RegisterAppInterfaceRequestTest
ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, is_cloud_app()).WillByDefault(Return(false));
+ ON_CALL(*mock_app, hybrid_app_preference())
+ .WillByDefault(ReturnRef(kHybridAppPreference));
ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId1));
ON_CALL(*mock_app, msg_version())
.WillByDefault(ReturnRef(mock_semantic_version));
@@ -190,6 +196,8 @@ class RegisterAppInterfaceRequestTest
ON_CALL(app_mngr_, IsAppInReconnectMode(_, _)).WillByDefault(Return(false));
ON_CALL(app_mngr_, application_by_policy_id(_))
.WillByDefault(Return(ApplicationSharedPtr()));
+ ON_CALL(app_mngr_, pending_application_by_policy_id(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
ON_CALL(
@@ -260,6 +268,8 @@ class RegisterAppInterfaceRequestTest
const utils::custom_string::CustomString app2_name_;
std::shared_ptr<sync_primitives::Lock> lock_ptr_;
am::ApplicationSet app_set_;
+ std::shared_ptr<sync_primitives::Lock> pending_lock_ptr_;
+ am::AppsWaitRegistrationSet pending_app_set_;
typedef IsNiceMock<policy_test::MockPolicyHandlerInterface,
kMocksAreNice>::Result MockPolicyHandlerInterface;
@@ -313,6 +323,9 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
ON_CALL(app_mngr_, applications())
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(app_mngr_, pending_applications())
+ .WillByDefault(Return(DataAccessor<am::AppsWaitRegistrationSet>(
+ pending_app_set_, pending_lock_ptr_)));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
@@ -432,6 +445,9 @@ TEST_F(RegisterAppInterfaceRequestTest,
ON_CALL(app_mngr_, applications())
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(app_mngr_, pending_applications())
+ .WillByDefault(Return(DataAccessor<am::AppsWaitRegistrationSet>(
+ pending_app_set_, pending_lock_ptr_)));
ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId1, _, _))
.WillByDefault(Return(true));
@@ -622,6 +638,9 @@ TEST_F(RegisterAppInterfaceRequestTest,
ON_CALL(app_mngr_, applications())
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(app_mngr_, pending_applications())
+ .WillByDefault(Return(DataAccessor<am::AppsWaitRegistrationSet>(
+ pending_app_set_, pending_lock_ptr_)));
MockAppPtr mock_app2 = CreateBasicMockedApp();
@@ -659,6 +678,9 @@ TEST_F(RegisterAppInterfaceRequestTest,
ON_CALL(app_mngr_, applications())
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(app_mngr_, pending_applications())
+ .WillByDefault(Return(DataAccessor<am::AppsWaitRegistrationSet>(
+ pending_app_set_, pending_lock_ptr_)));
InitBasicMessage();
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey2;