Send feedback
Class MockBackupDRConnection (2.33.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.33.0 keyboard_arrow_down
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
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-03-05 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-03-05 UTC."],[[["This webpage details the `MockBackupDRConnection` class, which is designed to simulate responses and errors for testing applications that use the `BackupDRClient`."],["The `MockBackupDRConnection` class provides mock implementations for numerous functions, such as `ListManagementServers`, `GetManagementServer`, `CreateBackupVault`, `GetBackupPlan`, and many more, all utilizing gMock's `MOCK_METHOD()`."],["The functions available allow developers to test various aspects of their `BackupDRClient` interactions, including listing, getting, creating, updating, deleting, and restoring data related to management servers, backup vaults, data sources, backups, and backup plans."],["The webpage provides links to documentation on GoogleTest and gMock, for developers to better understand how to use this class in testing, as well as a link to an example on using a similar mock type with BigQuery."],["There are many available versions of this document, from version 2.23.0 all the way up to the latest release candidate at 2.37.0-rc, with the current version being 2.33.0."]]],[]]