Class MockAdminServiceConnection (2.24.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::cloud::pubsublite::v1::SeekSubscriptionRequest 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::SeekSubscriptionRequest 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 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 > >