pull in new policy updates
[profile/ivi/smartdevicelink.git] / src / components / policy / test / policy / include / mock_pt_ext_representation.h
1 /* Copyright (c) 2014, Ford Motor Company
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided with the
13  * distribution.
14  *
15  * Neither the name of the Ford Motor Company nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 #ifndef TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
33 #define TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
34
35 #include "gmock/gmock.h"
36 #include "policy/pt_ext_representation.h"
37 #include "rpc_base/rpc_base.h"
38 #include "./types.h"
39 #include "mock_pt_representation.h"
40
41 namespace policy_table = ::rpc::policy_table_interface_base;
42
43 namespace policy {
44
45 class MockPTExtRepresentation : public MockPTRepresentation,
46   public PTExtRepresentation {
47   public:
48     MOCK_METHOD1(CanAppKeepContext,
49                  bool(const std::string& app_id));
50     MOCK_METHOD1(CanAppStealFocus,
51                  bool(const std::string& app_id));
52     MOCK_METHOD2(GetDefaultHMI,
53                  bool(const std::string& app_id, std::string* default_hmi));
54     MOCK_METHOD2(GetPriority,
55                  bool(const std::string& app_id, std::string* priority));
56     MOCK_METHOD0(ResetUserConsent,
57                  bool());
58     MOCK_METHOD0(ResetDeviceConsents, bool());
59     MOCK_METHOD0(ResetAppConsents, bool());
60     MOCK_METHOD3(GetUserPermissionsForDevice,
61                  bool(const std::string&, StringArray*, StringArray*));
62     MOCK_METHOD3(GetUserPermissionsForApp,
63                  bool(const std::string&, const std::string&,
64                       FunctionalIdType* group_types));
65     MOCK_METHOD2(GetDeviceGroupsFromPolicies,
66                  bool(policy_table::Strings*, policy_table::Strings*));
67     MOCK_METHOD2(GetUserFriendlyMsg,
68                  std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
69                      const std::string& language));
70     MOCK_METHOD7(SetDeviceData, bool (const std::string& device_id,
71                                       const std::string& hardware,
72                                       const std::string& firmware,
73                                       const std::string& os,
74                                       const std::string& os_version,
75                                       const std::string& carrier,
76                                       const uint32_t number_of_ports));
77     MOCK_METHOD6(SetDeviceData,
78                  bool(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&));
79     MOCK_METHOD2(SetMaxNumberPorts,
80                  bool(const std::string& device_id, unsigned int number_of_ports));
81     MOCK_METHOD3(SetUserPermissionsForDevice,
82                  bool(const std::string&, const StringArray&, const StringArray&));
83     MOCK_METHOD1(SetUserPermissionsForApp,
84                  bool(const PermissionConsent&));
85     MOCK_METHOD1(IncreaseStatisticsData,
86                  bool(StatisticsType type));
87     MOCK_METHOD3(SetAppRegistrationLanguage,
88                  bool(const std::string& app_id, LanguageType type, const std::string& language));
89     MOCK_METHOD3(SetMetaInfo,
90                  bool(const std::string& ccpu_version, const std::string& wers_country_code, const std::string& vin));
91     MOCK_METHOD1(SetSystemLanguage,
92                  bool(const std::string& language));
93     MOCK_METHOD0(GetKmFromSuccessfulExchange,
94                  int());
95     MOCK_METHOD0(GetDayFromScsExchange,
96                  int());
97     MOCK_METHOD0(GetIgnitionsFromScsExchange,
98                  int());
99     MOCK_CONST_METHOD1(Increment,
100                        void(const std::string& type));
101     MOCK_CONST_METHOD2(Increment,
102                        void(const std::string& app_id, const std::string& type));
103     MOCK_CONST_METHOD3(Set,
104                        void(const std::string& app_id, const std::string& type, const std::string& value));
105     MOCK_CONST_METHOD3(Add,
106                        void(const std::string& app_id, const std::string& type, int seconds));
107     MOCK_CONST_METHOD3(CountUnconsentedGroups,
108                        bool(const std::string& app_id,
109                             const std::string& device_id,
110                             int* count));
111     MOCK_METHOD1(GetFunctionalGroupNames,
112                  bool(FunctionalGroupNames& names));
113     MOCK_CONST_METHOD1(CleanupUnpairedDevices,
114                        bool(const DeviceIds& device_ids));
115     MOCK_METHOD2(ReactOnUserDevConsentForApp,
116                  bool(const std::string& app_id, bool is_device_allowed));
117     MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
118     MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
119     MOCK_CONST_METHOD1(SetUnpairedDevice, bool(const std::string& device_id));
120     MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
121 };
122
123 }  // namespace policy
124
125 #endif  // TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_