• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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,std::string & policyData,bool & isChanged)32     ErrCode OnHandlePolicy(std::uint32_t funcCode, MessageParcel &data, std::string &policyData,
33         bool &isChanged) override
34     {
35         return 0;
36     }
37 
OnHandlePolicyDone(std::uint32_t funcCode,const std::string & adminName,bool isGlobalChanged)38     void OnHandlePolicyDone(std::uint32_t funcCode, const std::string &adminName, bool isGlobalChanged) override {}
39 
OnAdminRemove(const std::string & adminName,const std::string & policyData)40     ErrCode OnAdminRemove(const std::string &adminName, const std::string &policyData) override
41     {
42         return 0;
43     }
44 
OnAdminRemoveDone(const std::string & adminName,const std::string & currentJsonData)45     void OnAdminRemoveDone(const std::string &adminName, const std::string &currentJsonData) override {}
46 
MockSetPolicyName(std::string policyName)47     void MockSetPolicyName(std::string policyName)
48     {
49         policyName_ = policyName;
50     }
51 };
52 } // namespace EDM
53 } // namespace OHOS
54 #endif // EDM_UNIT_TEST_ENTERPRISE_ADMIN_STUB_MOCK_H
55 
56