Class MockAckHandler (2.26.0)

The inlined, versioned namespace for the Cloud Pub/Sub C++ client APIs.

Applications may need to link multiple versions of the Cloud Pub/Sub C++ client, for example, if they link a library that uses an older version of the client than they do. This namespace is inlined, so applications can use pubsub::Foo in their source, but the symbols are versioned, i.e., the symbol becomes pubsub::v1::Foo. A googlemock-based mock for pubsub::AckHandler::Impl

See Also

Testing your Cloud Pub/Sub subscriber application with googlemock for an example using this class.

Functions

virtual ack()

The implementation for AckHandler::ack()

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Returns
Type Description
void

virtual nack()

The implementation for AckHandler::nack()

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Returns
Type Description
void

virtual ack_id()

Returns the ack id for the handler.

There is no corresponding public interface to access the ack id in AckHandler. This is for internal use only.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Returns
Type Description
std::string

virtual delivery_attempt() const

The implementation for AckHandler::delivery_attempt()

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Returns
Type Description
std::int32_t

virtual subscription() const

Returns the subscription for the handler.

There is no corresponding public interface to access the subscription id in AckHandler. This is for internal use only.

Returns
Type Description
pubsub::Subscription