1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef EDM_UNIT_TEST_IPLUGIN_MOCK_H
17 #define EDM_UNIT_TEST_IPLUGIN_MOCK_H
18 
19 #include <gmock/gmock.h>
20 #include <map>
21 
22 #include "iplugin.h"
23 
24 namespace OHOS {
25 namespace EDM {
26 class IPluginMock : public IPlugin {
27 public:
IPluginMock()28     IPluginMock() {}
29 
~IPluginMock()30     virtual ~IPluginMock() {}
31 
OnHandlePolicy(std::uint32_t funcCode,MessageParcel & data,MessageParcel & reply,HandlePolicyData & policyData,int32_t userId)32     ErrCode OnHandlePolicy(std::uint32_t funcCode, MessageParcel &data, MessageParcel &reply,
33         HandlePolicyData &policyData, int32_t userId) override
34     {
35         return 0;
36     }
37 
OnHandlePolicyDone(std::uint32_t funcCode,const std::string & adminName,bool isGlobalChanged,int32_t userId)38     void OnHandlePolicyDone(std::uint32_t funcCode, const std::string &adminName,
39         bool isGlobalChanged, int32_t userId) override {}
40 
OnAdminRemove(const std::string & adminName,const std::string & policyData,int32_t userId)41     ErrCode OnAdminRemove(const std::string &adminName, const std::string &policyData, int32_t userId) override
42     {
43         return 0;
44     }
45 
OnAdminRemoveDone(const std::string & adminName,const std::string & currentJsonData,int32_t userId)46     void OnAdminRemoveDone(const std::string &adminName, const std::string &currentJsonData,
47         int32_t userId) override {}
48 
MockSetPolicyName(std::string policyName)49     void MockSetPolicyName(std::string policyName)
50     {
51         policyName_ = policyName;
52     }
53 
OnGetPolicy(std::string & policyData,MessageParcel & data,MessageParcel & reply,int32_t userId)54     ErrCode OnGetPolicy(std::string &policyData, MessageParcel &data, MessageParcel &reply, int32_t userId)
55     {
56         return 0;
57     }
58 };
59 } // namespace EDM
60 } // namespace OHOS
61 #endif // EDM_UNIT_TEST_ENTERPRISE_ADMIN_STUB_MOCK_H
62 
63