• 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 #ifndef IAM_MOCK_USER_AUTH_SERVICE_H
16 #define IAM_MOCK_USER_AUTH_SERVICE_H
17 
18 #include <gmock/gmock.h>
19 
20 #include "user_auth_stub.h"
21 
22 namespace OHOS {
23 namespace UserIam {
24 namespace UserAuth {
25 class MockUserAuthService final : public UserAuthStub {
26 public:
27     MOCK_METHOD3(GetAvailableStatus, int32_t(int32_t apiVersion, AuthType authType, AuthTrustLevel authTrustLevel));
28 
29     MOCK_METHOD4(GetProperty,
30         void(int32_t userId, AuthType authType, const std::vector<Attributes::AttributeKey> &keys,
31             sptr<GetExecutorPropertyCallbackInterface> &callback));
32 
33     MOCK_METHOD4(SetProperty, void(int32_t userId, AuthType authType, const Attributes &attributes,
34                                   sptr<SetExecutorPropertyCallbackInterface> &callback));
35 
36     MOCK_METHOD5(AuthUser,
37         uint64_t(int32_t userId, const std::vector<uint8_t> &challenge, AuthType authType,
38             AuthTrustLevel authTrustLevel, sptr<UserAuthCallbackInterface> &callback));
39 
40     MOCK_METHOD5(Auth,
41         uint64_t(int32_t apiVersion, const std::vector<uint8_t> &challenge, AuthType authType,
42             AuthTrustLevel authTrustLevel, sptr<UserAuthCallbackInterface> &callback));
43 
44     MOCK_METHOD3(Identify,
45         uint64_t(const std::vector<uint8_t> &challenge, AuthType authType, sptr<UserAuthCallbackInterface> &callback));
46 
47     MOCK_METHOD1(CancelAuthOrIdentify, int32_t(uint64_t contextId));
48     MOCK_METHOD1(GetVersion, int32_t(int32_t &version));
49 };
50 } // namespace UserAuth
51 } // namespace UserIam
52 } // namespace OHOS
53 #endif // IAM_MOCK_USER_AUTH_SERVICE_H