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 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(const AuthConnInfo *connInfo, uint32_t requestId, 30 const AuthVerifyCallback *callback, AuthVerifyModule module, bool isFastAuth) = 0; 31 virtual int32_t AuthGetVersion(int64_t authId, SoftBusVersion *version) = 0; 32 virtual int32_t RegGroupChangeListener(const GroupChangeListener *listener) = 0; 33 }; 34 35 class LnnAuthtInterfaceMock : public LnnAuthInterface { 36 public: 37 LnnAuthtInterfaceMock(); 38 ~LnnAuthtInterfaceMock() override; 39 MOCK_METHOD5(AuthStartVerify, int32_t (const AuthConnInfo *, uint32_t, const AuthVerifyCallback *, 40 AuthVerifyModule, bool)); 41 MOCK_METHOD2(AuthGetVersion, int32_t (int64_t, SoftBusVersion *)); 42 MOCK_METHOD1(RegGroupChangeListener, int32_t (const GroupChangeListener *)); 43 }; 44 } // namespace OHOS 45 #endif // LNN_AUTH_MOCK_H