A class to mock SqlInstancesServiceConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type SqlInstancesServiceClient
. To do so, construct an object of type SqlInstancesServiceClient
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 AddServerCa(google::cloud::sql::v1::SqlInstancesAddServerCaRequest 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::sql::v1::SqlInstancesAddServerCaRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Clone(google::cloud::sql::v1::SqlInstancesCloneRequest 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::sql::v1::SqlInstancesCloneRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Delete(google::cloud::sql::v1::SqlInstancesDeleteRequest 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::sql::v1::SqlInstancesDeleteRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual DemoteMaster(google::cloud::sql::v1::SqlInstancesDemoteMasterRequest 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::sql::v1::SqlInstancesDemoteMasterRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Export(google::cloud::sql::v1::SqlInstancesExportRequest 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::sql::v1::SqlInstancesExportRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Failover(google::cloud::sql::v1::SqlInstancesFailoverRequest 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::sql::v1::SqlInstancesFailoverRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Reencrypt(google::cloud::sql::v1::SqlInstancesReencryptRequest 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::sql::v1::SqlInstancesReencryptRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Get(google::cloud::sql::v1::SqlInstancesGetRequest 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::sql::v1::SqlInstancesGetRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::DatabaseInstance > | |
virtual Import(google::cloud::sql::v1::SqlInstancesImportRequest 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::sql::v1::SqlInstancesImportRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Insert(google::cloud::sql::v1::SqlInstancesInsertRequest 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::sql::v1::SqlInstancesInsertRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual List(google::cloud::sql::v1::SqlInstancesListRequest)
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::sql::v1::SqlInstancesListRequest
|
Returns |
---|
Type | Description |
StreamRange< google::cloud::sql::v1::DatabaseInstance > | |
virtual ListServerCas(google::cloud::sql::v1::SqlInstancesListServerCasRequest 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::sql::v1::SqlInstancesListServerCasRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::InstancesListServerCasResponse > | |
virtual Patch(google::cloud::sql::v1::SqlInstancesPatchRequest 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::sql::v1::SqlInstancesPatchRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual PromoteReplica(google::cloud::sql::v1::SqlInstancesPromoteReplicaRequest 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::sql::v1::SqlInstancesPromoteReplicaRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Switchover(google::cloud::sql::v1::SqlInstancesSwitchoverRequest 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::sql::v1::SqlInstancesSwitchoverRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual ResetSslConfig(google::cloud::sql::v1::SqlInstancesResetSslConfigRequest 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::sql::v1::SqlInstancesResetSslConfigRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Restart(google::cloud::sql::v1::SqlInstancesRestartRequest 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::sql::v1::SqlInstancesRestartRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual RestoreBackup(google::cloud::sql::v1::SqlInstancesRestoreBackupRequest 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::sql::v1::SqlInstancesRestoreBackupRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual RotateServerCa(google::cloud::sql::v1::SqlInstancesRotateServerCaRequest 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::sql::v1::SqlInstancesRotateServerCaRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual StartReplica(google::cloud::sql::v1::SqlInstancesStartReplicaRequest 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::sql::v1::SqlInstancesStartReplicaRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual StopReplica(google::cloud::sql::v1::SqlInstancesStopReplicaRequest 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::sql::v1::SqlInstancesStopReplicaRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual TruncateLog(google::cloud::sql::v1::SqlInstancesTruncateLogRequest 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::sql::v1::SqlInstancesTruncateLogRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual Update(google::cloud::sql::v1::SqlInstancesUpdateRequest 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::sql::v1::SqlInstancesUpdateRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual CreateEphemeral(google::cloud::sql::v1::SqlInstancesCreateEphemeralCertRequest 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::sql::v1::SqlInstancesCreateEphemeralCertRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::SslCert > | |
virtual RescheduleMaintenance(google::cloud::sql::v1::SqlInstancesRescheduleMaintenanceRequest 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::sql::v1::SqlInstancesRescheduleMaintenanceRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual VerifyExternalSyncSettings(google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest 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::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsResponse > | |
virtual StartExternalSync(google::cloud::sql::v1::SqlInstancesStartExternalSyncRequest 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::sql::v1::SqlInstancesStartExternalSyncRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual PerformDiskShrink(google::cloud::sql::v1::SqlInstancesPerformDiskShrinkRequest 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::sql::v1::SqlInstancesPerformDiskShrinkRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual GetDiskShrinkConfig(google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigRequest 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::sql::v1::SqlInstancesGetDiskShrinkConfigRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigResponse > | |
virtual ResetReplicaSize(google::cloud::sql::v1::SqlInstancesResetReplicaSizeRequest 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::sql::v1::SqlInstancesResetReplicaSizeRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | |
virtual GetLatestRecoveryTime(google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest 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::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest const &
|
Returns |
---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeResponse > | |