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 LNN_AUTH_MOCK_H 17 #define LNN_AUTH_MOCK_H 18 19 #include <gmock/gmock.h> 20 #include <mutex> 21 22 #include "auth_interface.h" 23 24 namespace OHOS { 25 class LnnAuthInterface { 26 public: LnnAuthInterface()27 LnnAuthInterface() {}; ~LnnAuthInterface()28 virtual ~LnnAuthInterface() {}; 29 virtual int32_t AuthStartVerify( 30 const AuthConnInfo *connInfo, const AuthVerifyParam *authVerifyParam, const AuthVerifyCallback *callback) = 0; 31 virtual int32_t AuthGetVersion(int64_t authId, SoftBusVersion *version) = 0; 32 virtual int32_t RegGroupChangeListener(const GroupChangeListener *listener) = 0; 33 virtual bool IsSameAccountId(int64_t accountId) = 0; 34 }; 35 36 class LnnAuthtInterfaceMock : public LnnAuthInterface { 37 public: 38 LnnAuthtInterfaceMock(); 39 ~LnnAuthtInterfaceMock() override; 40 MOCK_METHOD3(AuthStartVerify, int32_t(const AuthConnInfo *, const AuthVerifyParam *, const AuthVerifyCallback *)); 41 MOCK_METHOD2(AuthGetVersion, int32_t(int64_t, SoftBusVersion *)); 42 MOCK_METHOD1(RegGroupChangeListener, int32_t(const GroupChangeListener *)); 43 MOCK_METHOD1(IsSameAccountId, bool(int64_t)); 44 }; 45 } // namespace OHOS 46 #endif // LNN_AUTH_MOCK_H