16#ifndef INCLUDED_RMQTESTMOCKS_MOCKPRODUCER
17#define INCLUDED_RMQTESTMOCKS_MOCKPRODUCER
19#include <rmqa_producer.h>
20#include <rmqp_messagetransformer.h>
21#include <rmqp_producer.h>
22#include <rmqt_future.h>
23#include <rmqt_message.h>
25#include <gmock/gmock.h>
27#include <bsl_memory.h>
28#include <bsl_string.h>
30namespace BloombergLP {
31namespace rmqtestmocks {
42 bsl::shared_ptr<rmqa::Producer> producer();
54 void(
const bsl::shared_ptr<rmqp::MessageTransformer>& transformer));
60 const bsl::string& routingKey,
62 const bsls::TimeInterval& timeout));
68 const bsl::string& routingKey,
69 rmqt::Mandatory::Value mandatory,
71 const bsls::TimeInterval& timeout));
77 const bsl::string& routingKey,
82 MOCK_METHOD2(updateTopology,
84 const bsls::TimeInterval&));
RabbitMQ Producer API for publishing to a specific Exchange.
Definition: rmqp_producer.h:46
virtual SendStatus send(const rmqt::Message &message, const bsl::string &routingKey, const rmqp::Producer::ConfirmationCallback &confirmCallback, const bsls::TimeInterval &timeout)=0
Send a message with the given routingKey to the exchange targeted by the producer.
virtual rmqt::Result waitForConfirms(const bsls::TimeInterval &timeout)=0
Wait for all outstanding publisher confirms to arrive.
virtual void addTransformer(const bsl::shared_ptr< rmqp::MessageTransformer > &transformer)=0
Adds a transformation function to be run on all messages.
bsl::function< void(const rmqt::Message &, const bsl::string &routingKey, const rmqt::ConfirmResponse &)> ConfirmationCallback
Invoked on receipt of message confirmation.
Definition: rmqp_producer.h:71
virtual SendStatus trySend(const rmqt::Message &message, const bsl::string &routingKey, const rmqp::Producer::ConfirmationCallback &confirmCallback)=0
Send a message with the given routingKey to the exchange targeted by the producer.
Definition: rmqa_producer.cpp:55
SendStatus
Possible results of rmqp::Producer::send.
Definition: rmqp_producer.h:50
virtual rmqt::Future updateTopologyAsync(const rmqt::TopologyUpdate &topologyUpdate)=0
Updates topology.
An async-style Future/Promise object.
Definition: rmqt_future.h:108
An AMQP content message.
Definition: rmqt_message.h:43
A result of an operation.
Definition: rmqt_result.h:37
Definition: rmqt_topologyupdate.h:33
Mocks rmqp::Producer and/or rmqa::Producer.
Definition: rmqtestmocks_mockproducer.h:36