diff options
Diffstat (limited to 'src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc')
-rw-r--r-- | src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc index 3c6377cf5f..ddb5474df3 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc @@ -259,25 +259,30 @@ TEST_F( PolicyManagerImplTest2, AddValidRequestTypeToPT_GetNewAppWithSpecificPoliciesViaPTU_ExpectRTAdded) { const std::string& app_id = application_id_; + const transport_manager::DeviceHandle handle = 1; // Arrange CreateLocalPT(preloaded_pt_filename_); + EXPECT_CALL(listener_, GetDevicesIds(app_id)) + .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_))); // Add app - policy_manager_->AddApplication(app_id, HmiTypes(policy_table::AHT_DEFAULT)); + policy_manager_->AddApplication( + device_id_1_, app_id, HmiTypes(policy_table::AHT_DEFAULT)); // Check app gets RequestTypes from pre_DataConsent of app_policies // section - pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id); + pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, app_id); // Only single item as in pre_DataConsent in preloaded PT EXPECT_EQ(1u, pt_request_types_.size()); - EXPECT_CALL(listener_, OnPendingPermissionChange(app_id)).Times(1); + EXPECT_CALL(listener_, OnPendingPermissionChange(device_id_1_, app_id)) + .Times(1); // PTU has RequestTypes as [] - means 'all allowed' Json::Value root = GetPTU("json/PTU2.json"); // Setting device consent to 'true' in order to have appropriate application // permissions, request type etc. - EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_)) + EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id)) .WillRepeatedly(Return(device_id_1_)); policy_manager_->SetUserConsentForDevice(device_id_1_, true); @@ -288,13 +293,13 @@ TEST_F( pt_request_types_.clear(); // Get RequestTypes from <app_id> section of app policies after PT update - pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id); + pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, app_id); // Check sizes of Request types of PT and PTU ASSERT_EQ(ptu_request_types_size_, pt_request_types_.size()); ::policy::AppPermissions permissions = - policy_manager_->GetAppPermissionsChanges(app_id); + policy_manager_->GetAppPermissionsChanges(device_id_1_, app_id); EXPECT_TRUE(permissions.requestTypeChanged); ::policy::StringArray result; |