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,const std::string & mergeData,int32_t userId)41 ErrCode OnAdminRemove(const std::string &adminName, const std::string &policyData, const std::string &mergeData, 42 int32_t userId) override 43 { 44 return 0; 45 } 46 OnAdminRemoveDone(const std::string & adminName,const std::string & currentJsonData,int32_t userId)47 void OnAdminRemoveDone(const std::string &adminName, const std::string ¤tJsonData, 48 int32_t userId) override {} 49 MockSetPolicyName(std::string policyName)50 void MockSetPolicyName(std::string policyName) 51 { 52 policyName_ = policyName; 53 } 54 OnGetPolicy(std::string & policyData,MessageParcel & data,MessageParcel & reply,int32_t userId)55 ErrCode OnGetPolicy(std::string &policyData, MessageParcel &data, MessageParcel &reply, int32_t userId) 56 { 57 return 0; 58 } 59 }; 60 } // namespace EDM 61 } // namespace OHOS 62 #endif // EDM_UNIT_TEST_ENTERPRISE_ADMIN_STUB_MOCK_H 63 64