1 /* 2 * Copyright (c) 2023-2024 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 BASE_NOTIFICATION_MOCK_ANS_SUBCRIBER_OBJECT_H 17 #define BASE_NOTIFICATION_MOCK_ANS_SUBCRIBER_OBJECT_H 18 19 #include "gmock/gmock.h" 20 #include "ans_subscriber_interface.h" 21 22 namespace OHOS { 23 namespace Notification { 24 class MockAnsSubscriber : public AnsSubscriberInterface { 25 public: MockAnsSubscriber()26 MockAnsSubscriber() {} ~MockAnsSubscriber()27 ~MockAnsSubscriber() {} 28 AsObject()29 sptr<IRemoteObject> AsObject() override 30 { 31 return nullptr; 32 } OnConnected()33 void OnConnected() override {}; 34 OnDisconnected()35 void OnDisconnected() override {}; 36 OnConsumed(const sptr<Notification> & notification,const sptr<NotificationSortingMap> & notificationMap)37 void OnConsumed( 38 const sptr<Notification> ¬ification, const sptr<NotificationSortingMap> ¬ificationMap) override {}; 39 40 MOCK_METHOD(void, OnConsumedList, (const std::vector<sptr<Notification>> ¬ifications, 41 const sptr<NotificationSortingMap> ¬ificationMap)); 42 OnCanceled(const sptr<Notification> & notification,const sptr<NotificationSortingMap> & notificationMap,int32_t deleteReason)43 void OnCanceled(const sptr<Notification> ¬ification, const sptr<NotificationSortingMap> ¬ificationMap, 44 int32_t deleteReason) override {}; 45 OnCanceledList(const std::vector<sptr<Notification>> & notifications,const sptr<NotificationSortingMap> & notificationMap,int32_t deleteReason)46 void OnCanceledList(const std::vector<sptr<Notification>> ¬ifications, 47 const sptr<NotificationSortingMap> ¬ificationMap, int32_t deleteReason) override {}; 48 OnUpdated(const sptr<NotificationSortingMap> & notificationMap)49 void OnUpdated(const sptr<NotificationSortingMap> ¬ificationMap) override {}; 50 OnDoNotDisturbDateChange(const sptr<NotificationDoNotDisturbDate> & date)51 void OnDoNotDisturbDateChange(const sptr<NotificationDoNotDisturbDate> &date) override {}; 52 OnEnabledNotificationChanged(const sptr<EnabledNotificationCallbackData> & callbackData)53 void OnEnabledNotificationChanged(const sptr<EnabledNotificationCallbackData> &callbackData) override {}; 54 OnBadgeChanged(const sptr<BadgeNumberCallbackData> & badgeData)55 void OnBadgeChanged(const sptr<BadgeNumberCallbackData> &badgeData) override {}; 56 OnBadgeEnabledChanged(const sptr<EnabledNotificationCallbackData> & callbackData)57 void OnBadgeEnabledChanged(const sptr<EnabledNotificationCallbackData> &callbackData) override {}; 58 }; 59 } // namespace Notification 60 } // namespace OHOS 61 #endif 62