• 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 MOCK_IEXECUTOR_H
17 #define MOCK_IEXECUTOR_H
18 
19 #include "gmock/gmock.h"
20 
21 #include "fingerprint_auth_hdi.h"
22 
23 namespace OHOS {
24 namespace UserIam {
25 namespace FingerprintAuth {
26 class MockIExecutor : public IExecutor {
27 public:
28     virtual ~MockIExecutor() = default;
29 
30     MOCK_METHOD1(GetExecutorInfo, int32_t(ExecutorInfo &executorInfo));
31     MOCK_METHOD2(GetTemplateInfo, int32_t(uint64_t templateId, TemplateInfo &templateInfo));
32     MOCK_METHOD3(OnRegisterFinish,
33         int32_t(const std::vector<uint64_t> &templateIdList, const std::vector<uint8_t> &frameworkPublicKey,
34             const std::vector<uint8_t> &extraInfo));
35     MOCK_METHOD3(Enroll,
36         int32_t(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
37             const sptr<IExecutorCallback> &callbackObj));
38     MOCK_METHOD4(Authenticate,
39         int32_t(uint64_t scheduleId, const std::vector<uint64_t> &templateIdList, const std::vector<uint8_t> &extraInfo,
40             const sptr<IExecutorCallback> &callbackObj));
41     MOCK_METHOD3(Identify,
42         int32_t(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
43             const sptr<IExecutorCallback> &callbackObj));
44     MOCK_METHOD1(Delete, int32_t(const std::vector<uint64_t> &templateIdList));
45     MOCK_METHOD1(Cancel, int32_t(uint64_t scheduleId));
46     MOCK_METHOD3(SendCommand,
47         int32_t(int32_t commandId, const std::vector<uint8_t> &extraInfo, const sptr<IExecutorCallback> &callbackObj));
48     MOCK_METHOD5(AuthenticateV1_1,
49         int32_t (uint64_t scheduleId, const std::vector<uint64_t>& templateIdList,
50             bool endAfterFirstFail, const std::vector<uint8_t>& extraInfo, const sptr<IExecutorCallback>& callbackObj));
51     MOCK_METHOD3(GetProperty, int32_t(const std::vector<uint64_t>& templateIdList,
52          const std::vector<GetPropertyType>& propertyTypes, Property& property));
53     MOCK_METHOD1(SetCachedTemplates, int32_t(const std::vector<uint64_t>& templateIdList));
54     MOCK_METHOD1(RegisterSaCommandCallback,
55         int32_t(const sptr<OHOS::HDI::FingerprintAuth::V1_1::ISaCommandCallback>& callbackObj));
56 };
57 } // namespace FingerprintAuth
58 } // namespace UserIam
59 } // namespace OHOS
60 
61 #endif // MOCK_IEXECUTOR_H