diff options
Diffstat (limited to 'src/components/policy/policy_external/test')
4 files changed, 13 insertions, 50 deletions
diff --git a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h index a1c808d23a..662632fc59 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h +++ b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h @@ -33,7 +33,6 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_ #include "gmock/gmock.h" - #include "policy/update_status_manager.h" namespace test { @@ -49,8 +48,8 @@ class MockUpdateStatusManager : public ::policy::UpdateStatusManager { MOCK_METHOD0(OnWrongUpdateReceived, void()); MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required)); MOCK_METHOD0(OnResetRetrySequence, void()); + MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required)); MOCK_METHOD1(OnNewApplicationAdded, void(const DeviceConsent)); - MOCK_METHOD1(OnPolicyInit, void(bool is_update_required)); MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus()); }; diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index dd9b43d53c..93d4e19751 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -113,27 +113,27 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) { EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg)); EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded()); - std::string priority = "emergency"; + std::string priority = "EMERGENCY"; uint32_t notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(1u, notif_number); - priority = "navigation"; + priority = "NAVIGATION"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(2u, notif_number); - priority = "emergency"; + priority = "EMERGENCY"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(1u, notif_number); - priority = "VOICECOMM"; + priority = "VOICECOM"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(3u, notif_number); - priority = "normal"; + priority = "NORMAL"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(5u, notif_number); - priority = "none"; + priority = "NONE"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(6u, notif_number); } diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc index 86b7cdc9ef..13efa39805 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc @@ -105,12 +105,12 @@ Json::Value createPTforLoad() { "}" "}," "\"notifications_per_minute_by_priority\": {" - "\"emergency\": 1," - "\"navigation\": 2," - "\"VOICECOMM\": 3," - "\"communication\": 4," - "\"normal\": 5," - "\"none\": 6" + "\"EMERGENCY\": 1," + "\"NAVIGATION\": 2," + "\"VOICECOM\": 3," + "\"COMMUNICATION\": 4," + "\"NORMAL\": 5," + "\"NONE\": 6" "}," "\"vehicle_make\" : \"MakeT\"," "\"vehicle_model\" : \"ModelT\"," diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc index 278c4fc43a..bf443bb201 100644 --- a/src/components/policy/policy_external/test/update_status_manager_test.cc +++ b/src/components/policy/policy_external/test/update_status_manager_test.cc @@ -287,42 +287,6 @@ TEST_F(UpdateStatusManagerTest, ScheduleUpdate_ExpectStatusUpdateNeeded) { } TEST_F(UpdateStatusManagerTest, - OnPolicyInit_SetUpdateRequired_ExpectStatusUpdateNeeded) { - // Arrange - manager_->OnPolicyInit(true); - status_ = manager_->GetLastUpdateStatus(); - // Checks - EXPECT_EQ(StatusUpdateRequired, status_); - EXPECT_FALSE(manager_->IsUpdatePending()); - EXPECT_TRUE(manager_->IsUpdateRequired()); -} - -TEST_F(UpdateStatusManagerTest, - OnPolicyInit_SetUpdateNotRequired_ExpectStatusUpToDate) { - // Arrange - manager_->OnPolicyInit(false); - status_ = manager_->GetLastUpdateStatus(); - // Checks - EXPECT_EQ(StatusUpToDate, status_); - EXPECT_FALSE(manager_->IsUpdatePending()); - EXPECT_FALSE(manager_->IsUpdateRequired()); -} - -TEST_F(UpdateStatusManagerTest, - StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) { - // Arrange - manager_->OnPolicyInit(false); - // Check - EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus()); - manager_->OnPolicyInit(true); - // Check - EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus()); - manager_->OnUpdateSentOut(k_timeout_); - // Check - EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus()); -} - -TEST_F(UpdateStatusManagerTest, OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) { // Arrange manager_->OnAppsSearchStarted(); |