A class to mock ManagedKafkaConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type ManagedKafkaClient
. To do so, construct an object of type ManagedKafkaClient
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 ListClusters(google::cloud::managedkafka::v1::ListClustersRequest)
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::managedkafka::v1::ListClustersRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::managedkafka::v1::Cluster > |
|
virtual GetCluster(google::cloud::managedkafka::v1::GetClusterRequest 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::managedkafka::v1::GetClusterRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::Cluster > |
|
virtual CreateCluster(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::managedkafka::v1::Cluster > > |
|
virtual UpdateCluster(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::managedkafka::v1::Cluster > > |
|
virtual DeleteCluster(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::managedkafka::v1::OperationMetadata > > |
|
virtual ListTopics(google::cloud::managedkafka::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::managedkafka::v1::ListTopicsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::managedkafka::v1::Topic > |
|
virtual GetTopic(google::cloud::managedkafka::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::managedkafka::v1::GetTopicRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::Topic > |
|
virtual CreateTopic(google::cloud::managedkafka::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::managedkafka::v1::CreateTopicRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::Topic > |
|
virtual UpdateTopic(google::cloud::managedkafka::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::managedkafka::v1::UpdateTopicRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::Topic > |
|
virtual DeleteTopic(google::cloud::managedkafka::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::managedkafka::v1::DeleteTopicRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual ListConsumerGroups(google::cloud::managedkafka::v1::ListConsumerGroupsRequest)
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::managedkafka::v1::ListConsumerGroupsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::managedkafka::v1::ConsumerGroup > |
|
virtual GetConsumerGroup(google::cloud::managedkafka::v1::GetConsumerGroupRequest 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::managedkafka::v1::GetConsumerGroupRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::ConsumerGroup > |
|
virtual UpdateConsumerGroup(google::cloud::managedkafka::v1::UpdateConsumerGroupRequest 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::managedkafka::v1::UpdateConsumerGroupRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::managedkafka::v1::ConsumerGroup > |
|
virtual DeleteConsumerGroup(google::cloud::managedkafka::v1::DeleteConsumerGroupRequest 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::managedkafka::v1::DeleteConsumerGroupRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual ListLocations(google::cloud::location::ListLocationsRequest)
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::location::ListLocationsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::location::Location > |
|
virtual GetLocation(google::cloud::location::GetLocationRequest 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::location::GetLocationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::location::Location > |
|
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 |
|