A class to mock BackupDRConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type BackupDRClient
. To do so, construct an object of type BackupDRClient
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 ListManagementServers(google::cloud::backupdr::v1::ListManagementServersRequest)
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::backupdr::v1::ListManagementServersRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::ManagementServer > |
|
virtual GetManagementServer(google::cloud::backupdr::v1::GetManagementServerRequest 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::backupdr::v1::GetManagementServerRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::ManagementServer > |
|
virtual CreateManagementServer(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::backupdr::v1::ManagementServer > > |
|
virtual DeleteManagementServer(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::backupdr::v1::OperationMetadata > > |
|
virtual CreateBackupVault(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::backupdr::v1::BackupVault > > |
|
virtual ListBackupVaults(google::cloud::backupdr::v1::ListBackupVaultsRequest)
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::backupdr::v1::ListBackupVaultsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::BackupVault > |
|
virtual FetchUsableBackupVaults(google::cloud::backupdr::v1::FetchUsableBackupVaultsRequest)
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::backupdr::v1::FetchUsableBackupVaultsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::BackupVault > |
|
virtual GetBackupVault(google::cloud::backupdr::v1::GetBackupVaultRequest 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::backupdr::v1::GetBackupVaultRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::BackupVault > |
|
virtual UpdateBackupVault(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::backupdr::v1::BackupVault > > |
|
virtual DeleteBackupVault(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::backupdr::v1::OperationMetadata > > |
|
virtual ListDataSources(google::cloud::backupdr::v1::ListDataSourcesRequest)
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::backupdr::v1::ListDataSourcesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::DataSource > |
|
virtual GetDataSource(google::cloud::backupdr::v1::GetDataSourceRequest 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::backupdr::v1::GetDataSourceRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::DataSource > |
|
virtual UpdateDataSource(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::backupdr::v1::DataSource > > |
|
virtual ListBackups(google::cloud::backupdr::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::backupdr::v1::ListBackupsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::Backup > |
|
virtual GetBackup(google::cloud::backupdr::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::backupdr::v1::GetBackupRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::Backup > |
|
virtual UpdateBackup(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::backupdr::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::cloud::backupdr::v1::Backup > > |
|
virtual RestoreBackup(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::backupdr::v1::RestoreBackupResponse > > |
|
virtual CreateBackupPlan(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::backupdr::v1::BackupPlan > > |
|
virtual GetBackupPlan(google::cloud::backupdr::v1::GetBackupPlanRequest 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::backupdr::v1::GetBackupPlanRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::BackupPlan > |
|
virtual ListBackupPlans(google::cloud::backupdr::v1::ListBackupPlansRequest)
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::backupdr::v1::ListBackupPlansRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::BackupPlan > |
|
virtual DeleteBackupPlan(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::backupdr::v1::OperationMetadata > > |
|
virtual CreateBackupPlanAssociation(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::backupdr::v1::BackupPlanAssociation > > |
|
virtual GetBackupPlanAssociation(google::cloud::backupdr::v1::GetBackupPlanAssociationRequest 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::backupdr::v1::GetBackupPlanAssociationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::backupdr::v1::BackupPlanAssociation > |
|
virtual ListBackupPlanAssociations(google::cloud::backupdr::v1::ListBackupPlanAssociationsRequest)
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::backupdr::v1::ListBackupPlanAssociationsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::backupdr::v1::BackupPlanAssociation > |
|
virtual DeleteBackupPlanAssociation(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::backupdr::v1::OperationMetadata > > |
|
virtual TriggerBackup(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::backupdr::v1::BackupPlanAssociation > > |
|
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 SetIamPolicy(google::iam::v1::SetIamPolicyRequest 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::iam::v1::SetIamPolicyRequest const &
|
Returns |
Type |
Description |
StatusOr< google::iam::v1::Policy > |
|
virtual GetIamPolicy(google::iam::v1::GetIamPolicyRequest 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::iam::v1::GetIamPolicyRequest const &
|
Returns |
Type |
Description |
StatusOr< google::iam::v1::Policy > |
|
virtual TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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::iam::v1::TestIamPermissionsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > |
|
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 |
|