Class MockAdminServiceConnection (2.32.0)

A class to mock AdminServiceConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type AdminServiceClient. To do so, construct an object of type AdminServiceClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

See Also

This example for how to test your application with GoogleTest. While the example showcases types from the BigQuery library, the underlying principles apply for any pair of *Client and *Connection.

Functions

virtual options()

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

Returns
Type Description
Options

virtual CreateTopic(google::cloud::pubsublite::v1::CreateTopicRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::CreateTopicRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Topic >

virtual GetTopic(google::cloud::pubsublite::v1::GetTopicRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::GetTopicRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Topic >

virtual GetTopicPartitions(google::cloud::pubsublite::v1::GetTopicPartitionsRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::GetTopicPartitionsRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::TopicPartitions >

virtual ListTopics(google::cloud::pubsublite::v1::ListTopicsRequest)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::ListTopicsRequest
Returns
Type Description
StreamRange< google::cloud::pubsublite::v1::Topic >

virtual UpdateTopic(google::cloud::pubsublite::v1::UpdateTopicRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::UpdateTopicRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Topic >

virtual DeleteTopic(google::cloud::pubsublite::v1::DeleteTopicRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::DeleteTopicRequest const &
Returns
Type Description
Status

virtual ListTopicSubscriptions(google::cloud::pubsublite::v1::ListTopicSubscriptionsRequest)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::ListTopicSubscriptionsRequest
Returns
Type Description
StreamRange< std::string >

virtual CreateSubscription(google::cloud::pubsublite::v1::CreateSubscriptionRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::CreateSubscriptionRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Subscription >

virtual GetSubscription(google::cloud::pubsublite::v1::GetSubscriptionRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::GetSubscriptionRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Subscription >

virtual ListSubscriptions(google::cloud::pubsublite::v1::ListSubscriptionsRequest)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::ListSubscriptionsRequest
Returns
Type Description
StreamRange< google::cloud::pubsublite::v1::Subscription >

virtual UpdateSubscription(google::cloud::pubsublite::v1::UpdateSubscriptionRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::UpdateSubscriptionRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Subscription >

virtual DeleteSubscription(google::cloud::pubsublite::v1::DeleteSubscriptionRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::DeleteSubscriptionRequest const &
Returns
Type Description
Status

virtual SeekSubscription(google::longrunning::Operation const &)

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

Parameter
Name Description
operation google::longrunning::Operation const &
Returns
Type Description
future< StatusOr< google::cloud::pubsublite::v1::SeekSubscriptionResponse > >

virtual CreateReservation(google::cloud::pubsublite::v1::CreateReservationRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::CreateReservationRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Reservation >

virtual GetReservation(google::cloud::pubsublite::v1::GetReservationRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::GetReservationRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Reservation >

virtual ListReservations(google::cloud::pubsublite::v1::ListReservationsRequest)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::ListReservationsRequest
Returns
Type Description
StreamRange< google::cloud::pubsublite::v1::Reservation >

virtual UpdateReservation(google::cloud::pubsublite::v1::UpdateReservationRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::UpdateReservationRequest const &
Returns
Type Description
StatusOr< google::cloud::pubsublite::v1::Reservation >

virtual DeleteReservation(google::cloud::pubsublite::v1::DeleteReservationRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::DeleteReservationRequest const &
Returns
Type Description
Status

virtual ListReservationTopics(google::cloud::pubsublite::v1::ListReservationTopicsRequest)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::ListReservationTopicsRequest
Returns
Type Description
StreamRange< std::string >

virtual ListOperations(google::longrunning::ListOperationsRequest)

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

Parameter
Name Description
request google::longrunning::ListOperationsRequest
Returns
Type Description
StreamRange< google::longrunning::Operation >

virtual GetOperation(google::longrunning::GetOperationRequest const &)

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

Parameter
Name Description
request google::longrunning::GetOperationRequest const &
Returns
Type Description
StatusOr< google::longrunning::Operation >

virtual DeleteOperation(google::longrunning::DeleteOperationRequest const &)

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

Parameter
Name Description
request google::longrunning::DeleteOperationRequest const &
Returns
Type Description
Status

virtual CancelOperation(google::longrunning::CancelOperationRequest const &)

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

Parameter
Name Description
request google::longrunning::CancelOperationRequest const &
Returns
Type Description
Status

virtual AsyncGetTopicPartitions(google::cloud::pubsublite::v1::GetTopicPartitionsRequest const &)

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

Parameter
Name Description
request google::cloud::pubsublite::v1::GetTopicPartitionsRequest const &
Returns
Type Description
future< StatusOr< google::cloud::pubsublite::v1::TopicPartitions > >