summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/test/cache_manager_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/test/cache_manager_test.cc')
-rw-r--r--src/components/policy/policy_external/test/cache_manager_test.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/test/cache_manager_test.cc b/src/components/policy/policy_external/test/cache_manager_test.cc
index 440df431db..746d0c7221 100644
--- a/src/components/policy/policy_external/test/cache_manager_test.cc
+++ b/src/components/policy/policy_external/test/cache_manager_test.cc
@@ -243,6 +243,51 @@ TEST_F(CacheManagerTest,
}
TEST_F(CacheManagerTest,
+ GetNotificationsNumber_Subtle_FieldNotPresent_UseFallback) {
+ const std::string string_table(
+ "{"
+ "\"policy_table\": {"
+ "\"module_config\": {"
+ "\"notifications_per_minute_by_priority\": {"
+ "\"EMERGENCY\": 1,"
+ "\"NAVIGATION\": 2,"
+ "\"VOICECOM\": 3,"
+ "\"COMMUNICATION\": 4,"
+ "\"NORMAL\": 5,"
+ "\"NONE\": 6"
+ "}"
+ "}"
+ "}"
+ "}");
+ *pt_ = CreateCustomPT(string_table);
+
+ std::string priority = "EMERGENCY";
+ uint32_t notif_number =
+ cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(1u, notif_number);
+
+ priority = "NAVIGATION";
+ notif_number = cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(2u, notif_number);
+
+ priority = "VOICECOM";
+ notif_number = cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(3u, notif_number);
+
+ priority = "COMMUNICATION";
+ notif_number = cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(4u, notif_number);
+
+ priority = "NORMAL";
+ notif_number = cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(5u, notif_number);
+
+ priority = "NONE";
+ notif_number = cache_manager_->GetNotificationsNumber(priority, true);
+ EXPECT_EQ(6u, notif_number);
+}
+
+TEST_F(CacheManagerTest,
GetConsentsPriority_DeviceIDNotFound_ReturnkExternalConsentPrio) {
const auto priority =
cache_manager_->GetConsentsPriority(kDeviceNumber, kValidAppId);