Class MockConfigConnection (2.31.0)

A class to mock ConfigConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type ConfigClient. To do so, construct an object of type ConfigClient 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 ListDeployments(google::cloud::config::v1::ListDeploymentsRequest)

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::config::v1::ListDeploymentsRequest
Returns
Type Description
StreamRange< google::cloud::config::v1::Deployment >

virtual GetDeployment(google::cloud::config::v1::GetDeploymentRequest 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::config::v1::GetDeploymentRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Deployment >

virtual CreateDeployment(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::config::v1::Deployment > >

virtual UpdateDeployment(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::config::v1::Deployment > >

virtual DeleteDeployment(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::config::v1::Deployment > >

virtual ListRevisions(google::cloud::config::v1::ListRevisionsRequest)

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::config::v1::ListRevisionsRequest
Returns
Type Description
StreamRange< google::cloud::config::v1::Revision >

virtual GetRevision(google::cloud::config::v1::GetRevisionRequest 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::config::v1::GetRevisionRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Revision >

virtual GetResource(google::cloud::config::v1::GetResourceRequest 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::config::v1::GetResourceRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Resource >

virtual ListResources(google::cloud::config::v1::ListResourcesRequest)

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::config::v1::ListResourcesRequest
Returns
Type Description
StreamRange< google::cloud::config::v1::Resource >

virtual ExportDeploymentStatefile(google::cloud::config::v1::ExportDeploymentStatefileRequest 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::config::v1::ExportDeploymentStatefileRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Statefile >

virtual ExportRevisionStatefile(google::cloud::config::v1::ExportRevisionStatefileRequest 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::config::v1::ExportRevisionStatefileRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Statefile >

virtual ImportStatefile(google::cloud::config::v1::ImportStatefileRequest 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::config::v1::ImportStatefileRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Statefile >

virtual DeleteStatefile(google::cloud::config::v1::DeleteStatefileRequest 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::config::v1::DeleteStatefileRequest const &
Returns
Type Description
Status

virtual LockDeployment(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::config::v1::Deployment > >

virtual UnlockDeployment(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::config::v1::Deployment > >

virtual ExportLockInfo(google::cloud::config::v1::ExportLockInfoRequest 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::config::v1::ExportLockInfoRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::LockInfo >

virtual CreatePreview(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::config::v1::Preview > >

virtual GetPreview(google::cloud::config::v1::GetPreviewRequest 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::config::v1::GetPreviewRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::Preview >

virtual ListPreviews(google::cloud::config::v1::ListPreviewsRequest)

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::config::v1::ListPreviewsRequest
Returns
Type Description
StreamRange< google::cloud::config::v1::Preview >

virtual DeletePreview(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::config::v1::Preview > >

virtual ExportPreviewResult(google::cloud::config::v1::ExportPreviewResultRequest 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::config::v1::ExportPreviewResultRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::ExportPreviewResultResponse >

virtual ListTerraformVersions(google::cloud::config::v1::ListTerraformVersionsRequest)

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::config::v1::ListTerraformVersionsRequest
Returns
Type Description
StreamRange< google::cloud::config::v1::TerraformVersion >

virtual GetTerraformVersion(google::cloud::config::v1::GetTerraformVersionRequest 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::config::v1::GetTerraformVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::config::v1::TerraformVersion >

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