Send feedback
Class MockCloudRedisClusterConnection (2.40.0-rc)
Stay organized with collections
Save and categorize content based on your preferences.
Version latestkeyboard_arrow_down
A class to mock CloudRedisClusterConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type CloudRedisClusterClient
. To do so, construct an object of type CloudRedisClusterClient
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::redis::cluster::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::redis::cluster::v1::ListClustersRequest
Returns
Type
Description
StreamRange< google::cloud::redis::cluster::v1::Cluster >
virtual GetCluster(google::cloud::redis::cluster::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::redis::cluster::v1::GetClusterRequest const &
Returns
Type
Description
StatusOr< google::cloud::redis::cluster::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::redis::cluster::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::protobuf::Any > >
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::redis::cluster::v1::Cluster > >
virtual GetClusterCertificateAuthority(google::cloud::redis::cluster::v1::GetClusterCertificateAuthorityRequest 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::redis::cluster::v1::GetClusterCertificateAuthorityRequest const &
Returns
Type
Description
StatusOr< google::cloud::redis::cluster::v1::CertificateAuthority >
virtual RescheduleClusterMaintenance(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::redis::cluster::v1::Cluster > >
virtual ListBackupCollections(google::cloud::redis::cluster::v1::ListBackupCollectionsRequest)
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::redis::cluster::v1::ListBackupCollectionsRequest
Returns
Type
Description
StreamRange< google::cloud::redis::cluster::v1::BackupCollection >
virtual GetBackupCollection(google::cloud::redis::cluster::v1::GetBackupCollectionRequest 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::redis::cluster::v1::GetBackupCollectionRequest const &
Returns
Type
Description
StatusOr< google::cloud::redis::cluster::v1::BackupCollection >
virtual ListBackups(google::cloud::redis::cluster::v1::ListBackupsRequest)
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::redis::cluster::v1::ListBackupsRequest
Returns
Type
Description
StreamRange< google::cloud::redis::cluster::v1::Backup >
virtual GetBackup(google::cloud::redis::cluster::v1::GetBackupRequest 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::redis::cluster::v1::GetBackupRequest const &
Returns
Type
Description
StatusOr< google::cloud::redis::cluster::v1::Backup >
virtual DeleteBackup(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::protobuf::Any > >
virtual ExportBackup(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::redis::cluster::v1::Backup > >
virtual BackupCluster(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::redis::cluster::v1::Cluster > >
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
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-09 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["This webpage details the `MockCloudRedisClusterConnection` class, which is designed for application developers to simulate interactions with `CloudRedisClusterClient` for testing purposes."],["The latest version of the `MockCloudRedisClusterConnection` is 2.37.0-rc, and the page provides links to documentation for numerous prior versions, dating back to 2.11.0."],["The `MockCloudRedisClusterConnection` class is built with gMock's `MOCK_METHOD()`, allowing for flexible simulation of various operations and responses, as exemplified in the provided test documentation."],["The class supports a wide array of virtual functions for mocking interactions, including operations related to clusters, backup collections, backups, locations, and general operations."],["Example usage of this class can be found in the BigQuery library documentation, which showcases types from that library but explains how the same principles can apply to the CloudRedisClusterClient library."]]],[]]