Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
mock_ack_handler.h
1// Copyright 2020 Google LLC
2//
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// https://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 GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_MOCKS_MOCK_ACK_HANDLER_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_MOCKS_MOCK_ACK_HANDLER_H
17
18#include "google/cloud/pubsub/ack_handler.h"
19#include <gmock/gmock.h>
20#include <string>
21
22namespace google {
23namespace cloud {
24/// A namespace for googlemock-based Cloud Pub/Sub C++ client mocks.
25namespace pubsub_mocks {
26/**
27 * The inlined, versioned namespace for the Cloud Pub/Sub C++ client APIs.
28 *
29 * Applications may need to link multiple versions of the Cloud Pub/Sub C++
30 * client, for example, if they link a library that uses an older version of
31 * the client than they do. This namespace is inlined, so applications can use
32 * `pubsub::Foo` in their source, but the symbols are versioned, i.e., the
33 * symbol becomes `pubsub::v1::Foo`.
34 */
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37/**
38 * A googlemock-based mock for [pubsub::AckHandler::Impl][mocked-link]
39 *
40 * [mocked-link]: @ref google::cloud::pubsub::AckHandler::Impl
41 *
42 * @see @ref subscriber-mock for an example using this class.
43 */
44class MockAckHandler : public pubsub::AckHandler::Impl {
45 public:
46 MOCK_METHOD(void, ack, (), (override));
47 MOCK_METHOD(void, nack, (), (override));
48 MOCK_METHOD(std::string, ack_id, ());
49 MOCK_METHOD(std::int32_t, delivery_attempt, (), (const, override));
50};
51
52GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
53} // namespace pubsub_mocks
54} // namespace cloud
55} // namespace google
56
57#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_MOCKS_MOCK_ACK_HANDLER_H
Allow applications to mock an AckHandler.
Definition: ack_handler.h:91
Defines the interface to acknowledge and reject messages.
Definition: ack_handler.h:49
The inlined, versioned namespace for the Cloud Pub/Sub C++ client APIs.
Definition: mock_ack_handler.h:44
A namespace for googlemock-based Cloud Pub/Sub C++ client mocks.
Definition: mock_ack_handler.h:25
Contains all the Cloud Pub/Sub C++ client types and functions.
Definition: ack_handler.h:25
The namespace Google Cloud Platform C++ client libraries.