Class MockDatabaseAdminConnection (2.12.0)

Application developers may want to test their code with simulated responses, including errors from a spanner::DatabaseAdminClient. To do so, construct a spanner::DatabaseAdminClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

Functions

CreateDatabase(CreateDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.CreateDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
CreateDatabaseParams
Returns
Type Description
future< StatusOr< google::spanner::admin::database::v1::Database > >

GetDatabase(GetDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetDatabaseParams
Returns
Type Description
StatusOr< google::spanner::admin::database::v1::Database >

GetDatabaseDdl(GetDatabaseDdlParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabaseDdl RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetDatabaseDdlParams
Returns
Type Description
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse >

UpdateDatabase(UpdateDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
UpdateDatabaseParams
Returns
Type Description
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > >

DropDatabase(DropDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
DropDatabaseParams
Returns
Type Description
Status

ListDatabases(ListDatabasesParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
ListDatabasesParams
Returns
Type Description
ListDatabaseRange

virtual RestoreDatabase(RestoreDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.RestoreDatabase RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
RestoreDatabaseParams
Returns
Type Description
future< StatusOr< google::spanner::admin::database::v1::Database > >

GetIamPolicy(GetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetIamPolicy RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetIamPolicyParams
Returns
Type Description
StatusOr< google::iam::v1::Policy >

SetIamPolicy(SetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.SetIamPolicy RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
SetIamPolicyParams
Returns
Type Description
StatusOr< google::iam::v1::Policy >

TestIamPermissions(TestIamPermissionsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
TestIamPermissionsParams
Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual CreateBackup(CreateBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.CreateBackup RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
CreateBackupParams
Returns
Type Description
future< StatusOr< google::spanner::admin::database::v1::Backup > >

virtual GetBackup(GetBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetBackup RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetBackupParams
Returns
Type Description
StatusOr< google::spanner::admin::database::v1::Backup >

virtual DeleteBackup(DeleteBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DeleteBackup RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
DeleteBackupParams
Returns
Type Description
Status

virtual ListBackups(ListBackupsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackups RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
ListBackupsParams
Returns
Type Description
ListBackupsRange

virtual UpdateBackup(UpdateBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateBackup RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
UpdateBackupParams
Returns
Type Description
StatusOr< google::spanner::admin::database::v1::Backup >

virtual ListBackupOperations(ListBackupOperationsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackupOperations RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
ListBackupOperationsParams
Returns
Type Description
ListBackupOperationsRange

virtual ListDatabaseOperations(ListDatabaseOperationsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListDatabaseOperations RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
ListDatabaseOperationsParams
Returns
Type Description
ListDatabaseOperationsRange

virtual options()

Returns
Type Description
Options