1 /* 2 * Copyright (c) 2022-2025 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 OS_ACCOUNT_SERVICES_ACCOUNTMGR_TEST_MOCK_APP_ACCOUNT_MOCK_APP_ACCOUNT_AUTHENTICATOR_STUB_H 17 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_TEST_MOCK_APP_ACCOUNT_MOCK_APP_ACCOUNT_AUTHENTICATOR_STUB_H 18 19 #include "app_account_authenticator_stub.h" 20 21 namespace OHOS { 22 namespace AccountSA { 23 class MockAppAccountAuthenticator : public AppAccountAuthenticatorStub { 24 public: 25 ErrCode AddAccountImplicitly(const std::string &authType, const std::string &callerBundleName, 26 const AAFwk::WantParams &options, const sptr<IRemoteObject> &callback, int32_t &funcResult); 27 ErrCode Authenticate(const AppAccountAuthenticatorStringInfo &stringInfo, const AAFwk::WantParams &options, 28 const sptr<IRemoteObject> &callback, int32_t &funcResult); 29 ErrCode VerifyCredential( 30 const std::string &name, const VerifyCredentialOptions &options, const sptr<IRemoteObject> &callback, 31 int32_t &funcResult); 32 ErrCode CheckAccountLabels( 33 const std::string &name, const std::vector<std::string> &labels, const sptr<IRemoteObject> &callback, 34 int32_t &funcResult); 35 ErrCode SetProperties(const SetPropertiesOptions &options, const sptr<IRemoteObject> &callback, 36 int32_t &funcResult); 37 ErrCode IsAccountRemovable(const std::string &name, const sptr<IRemoteObject> &callback, int32_t &funcResult); 38 ErrCode CreateAccountImplicitly(const CreateAccountImplicitlyOptions &options, const sptr<IRemoteObject> &callback, 39 int32_t &funcResult); 40 ErrCode Auth(const std::string &name, const std::string &authType, const AAFwk::WantParams &options, 41 const sptr<IRemoteObject> &callback, int32_t &funcResult); 42 43 public: 44 bool status = true; 45 }; 46 } // namespace AccountSA 47 } // namespace OHOS 48 49 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_TEST_MOCK_APP_ACCOUNT_MOCK_APP_ACCOUNT_AUTHENTICATOR_STUB_H