Class google::cloud::secretmanager_v1_mocks::MockSecretManagerServiceConnection (2.10.1)

A class to mock SecretManagerServiceConnection.

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

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

ListSecrets

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::secretmanager::v1::ListSecretsRequest
Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::Secret >

CreateSecret

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::secretmanager::v1::CreateSecretRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret >

AddSecretVersion

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::secretmanager::v1::AddSecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

GetSecret

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::secretmanager::v1::GetSecretRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret >

UpdateSecret

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::secretmanager::v1::UpdateSecretRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret >

DeleteSecret

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::secretmanager::v1::DeleteSecretRequest const &
Returns
Type Description
Status

ListSecretVersions

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::secretmanager::v1::ListSecretVersionsRequest
Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::SecretVersion >

GetSecretVersion

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::secretmanager::v1::GetSecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

AccessSecretVersion

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::secretmanager::v1::AccessSecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse >

DisableSecretVersion

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::secretmanager::v1::DisableSecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

EnableSecretVersion

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::secretmanager::v1::EnableSecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

DestroySecretVersion

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::secretmanager::v1::DestroySecretVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

SetIamPolicy

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 >

GetIamPolicy

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 >

TestIamPermissions

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 >