1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef FCP_AGGREGATION_PROTOCOL_TESTING_TEST_CALLBACK_H_ 18 #define FCP_AGGREGATION_PROTOCOL_TESTING_TEST_CALLBACK_H_ 19 20 #include "gmock/gmock.h" 21 #include "fcp/aggregation/protocol/aggregation_protocol.h" 22 #include "fcp/aggregation/protocol/aggregation_protocol_messages.pb.h" 23 24 namespace fcp::aggregation { 25 26 class MockAggregationProtocolCallback : public AggregationProtocol::Callback { 27 public: 28 MOCK_METHOD(void, OnAcceptClients, 29 (int64_t start_client_id, int64_t num_clients, 30 const AcceptanceMessage& message), 31 (override)); 32 MOCK_METHOD(void, OnSendServerMessage, 33 (int64_t client_id, const ServerMessage& message), (override)); 34 MOCK_METHOD(void, OnCloseClient, 35 (int64_t client_id, absl::Status diagnostic_status), (override)); 36 MOCK_METHOD(void, OnComplete, (absl::Cord result), (override)); 37 MOCK_METHOD(void, OnAbort, (absl::Status diagnostic_status), (override)); 38 }; 39 40 } // namespace fcp::aggregation 41 42 #endif // FCP_AGGREGATION_PROTOCOL_TESTING_TEST_CALLBACK_H_ 43