RMQ - RabbitMQ C++ Library
rmqtestmocks_mockmessageguard.h
1// Copyright 2020-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
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#ifndef INCLUDED_RMQTESTMOCKS_MOCKMESSAGEGUARD
17#define INCLUDED_RMQTESTMOCKS_MOCKMESSAGEGUARD
18
19#include <rmqp_messageguard.h>
20#include <rmqt_consumerack.h>
21#include <rmqt_message.h>
22
23#include <gmock/gmock.h>
24
25namespace BloombergLP {
26namespace rmqtestmocks {
27
29 public:
31 virtual ~MockMessageGuard();
32
33 MOCK_CONST_METHOD0(message, const rmqt::Message&());
34 MOCK_CONST_METHOD0(envelope, const rmqt::Envelope&());
35 MOCK_METHOD0(ack, void());
36 MOCK_METHOD1(nack, void(bool));
37 MOCK_CONST_METHOD0(consumer, rmqp::Consumer*());
38
39 MOCK_METHOD0(transferOwnership, rmqp::TransferrableMessageGuard());
40
41 private:
43 MockMessageGuard& operator=(const MockMessageGuard& other);
44
45}; // class MockMessageGuard
46
47} // namespace rmqtestmocks
48} // namespace BloombergLP
49
50#endif // ! INCLUDED_RMQTESTMOCKS_MOCKMESSAGEGUARD
Provide a RabbitMQ Async Consumer API.
Definition: rmqp_consumer.h:38
An interface for MessageGuard class.
Definition: rmqp_messageguard.h:39
virtual const rmqt::Message & message() const =0
Access the received message.
virtual const rmqt::Envelope & envelope() const =0
Access the received message envelope (delivery details)
virtual Consumer * consumer() const =0
Reference to the Consumer.
virtual TransferrableMessageGuard transferOwnership()=0
virtual void nack(bool requeue=true)=0
Provide a class that holds additional data about rmqt::Message.
Definition: rmqt_envelope.h:32
An AMQP content message.
Definition: rmqt_message.h:43
Definition: rmqtestmocks_mockmessageguard.h:28