Class MockSecretManagerServiceConnection (2.20.0)

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

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 ListSecrets(google::cloud::secretmanager::v1::ListSecretsRequest)

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 >

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

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

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

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

virtual DeleteSecret(google::cloud::secretmanager::v1::DeleteSecretRequest 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::secretmanager::v1::DeleteSecretRequest const &
Returns
Type Description
Status

virtual ListSecretVersions(google::cloud::secretmanager::v1::ListSecretVersionsRequest)

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 >

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

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

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

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

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

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 >