• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #ifndef IAM_MOCK_EVENT_LISTENER_INTERFACE_H
16 #define IAM_MOCK_EVENT_LISTENER_INTERFACE_H
17 
18 #include <gmock/gmock.h>
19 
20 #include "event_listener_callback_stub.h"
21 #include "user_auth_client_callback.h"
22 #include "iam_common_defines.h"
23 
24 namespace OHOS {
25 namespace UserIam {
26 namespace UserAuth {
27 class MockEventListener final : public IEventListenerCallback {
28 public:
29     MOCK_METHOD0(AsObject, sptr<IRemoteObject>());
30     MOCK_METHOD4(OnNotifyAuthSuccessEvent, int32_t(int32_t userId, int32_t authType, int32_t callerType,
31         const std::string &callerName));
32     MOCK_METHOD4(OnNotifyCredChangeEvent, int32_t(int32_t userId, int32_t authType, int32_t eventType,
33         const IpcCredChangeEventInfo &changeInfo));
34 };
35 
36 class MockEventListenerService final : public IRemoteStub<IEventListenerCallback> {
37 public:
38     MOCK_METHOD4(OnRemoteRequest,
39         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
40     MOCK_METHOD4(OnNotifyAuthSuccessEvent, int32_t(int32_t userId, int32_t authType, int32_t callerType,
41         const std::string &callerName));
42     MOCK_METHOD4(OnNotifyCredChangeEvent, int32_t(int32_t userId, int32_t authType, int32_t eventType,
43         const IpcCredChangeEventInfo &changeInfo));
44 };
45 } // namespace UserAuth
46 } // namespace UserIam
47 } // namespace OHOS
48 #endif // IAM_MOCK_EVENT_LISTENER_INTERFACE_H