Class MockBackupForGKEConnection (2.28.0)

A class to mock BackupForGKEConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type BackupForGKEClient. To do so, construct an object of type BackupForGKEClient 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 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::gkebackup::v1::BackupPlan > >

virtual ListBackupPlans(google::cloud::gkebackup::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::gkebackup::v1::ListBackupPlansRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::BackupPlan >

virtual GetBackupPlan(google::cloud::gkebackup::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::gkebackup::v1::GetBackupPlanRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::BackupPlan >

virtual UpdateBackupPlan(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::gkebackup::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::gkebackup::v1::OperationMetadata > >

virtual CreateBackup(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::gkebackup::v1::Backup > >

virtual ListBackups(google::cloud::gkebackup::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::gkebackup::v1::ListBackupsRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::Backup >

virtual GetBackup(google::cloud::gkebackup::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::gkebackup::v1::GetBackupRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::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::gkebackup::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::gkebackup::v1::OperationMetadata > >

virtual ListVolumeBackups(google::cloud::gkebackup::v1::ListVolumeBackupsRequest)

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::gkebackup::v1::ListVolumeBackupsRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::VolumeBackup >

virtual GetVolumeBackup(google::cloud::gkebackup::v1::GetVolumeBackupRequest 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::gkebackup::v1::GetVolumeBackupRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::VolumeBackup >

virtual CreateRestorePlan(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::gkebackup::v1::RestorePlan > >

virtual ListRestorePlans(google::cloud::gkebackup::v1::ListRestorePlansRequest)

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::gkebackup::v1::ListRestorePlansRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::RestorePlan >

virtual GetRestorePlan(google::cloud::gkebackup::v1::GetRestorePlanRequest 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::gkebackup::v1::GetRestorePlanRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::RestorePlan >

virtual UpdateRestorePlan(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::gkebackup::v1::RestorePlan > >

virtual DeleteRestorePlan(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::gkebackup::v1::OperationMetadata > >

virtual CreateRestore(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::gkebackup::v1::Restore > >

virtual ListRestores(google::cloud::gkebackup::v1::ListRestoresRequest)

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::gkebackup::v1::ListRestoresRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::Restore >

virtual GetRestore(google::cloud::gkebackup::v1::GetRestoreRequest 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::gkebackup::v1::GetRestoreRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::Restore >

virtual UpdateRestore(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::gkebackup::v1::Restore > >

virtual DeleteRestore(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::gkebackup::v1::OperationMetadata > >

virtual ListVolumeRestores(google::cloud::gkebackup::v1::ListVolumeRestoresRequest)

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::gkebackup::v1::ListVolumeRestoresRequest
Returns
Type Description
StreamRange< google::cloud::gkebackup::v1::VolumeRestore >

virtual GetVolumeRestore(google::cloud::gkebackup::v1::GetVolumeRestoreRequest 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::gkebackup::v1::GetVolumeRestoreRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::VolumeRestore >

virtual GetBackupIndexDownloadUrl(google::cloud::gkebackup::v1::GetBackupIndexDownloadUrlRequest 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::gkebackup::v1::GetBackupIndexDownloadUrlRequest const &
Returns
Type Description
StatusOr< google::cloud::gkebackup::v1::GetBackupIndexDownloadUrlResponse >